#NEWLINE# def get_instance_vdis_for_sr( session , vm_ref , sr_ref ) : #NEWLINE# #INDENT# 'Return opaqueRef for all the vdis which live on sr.' #NEWLINE# for vbd_ref in session . call_xenapi ( 'VM.get_VBDs' , vm_ref ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# vdi_ref = session . call_xenapi ( 'VBD.get_VDI' , vbd_ref ) #NEWLINE# if ( session == session . call_xenapi ( 'VDI.get_SR' , vdi_ref ) ) : #NEWLINE# #INDENT# ( yield vdi_ref ) #NEWLINE# #UNINDENT# #UNINDENT# except session . XenAPI . Failure : #NEWLINE# #INDENT# continue