def lookup_vm_vdis(session, vm_ref):
 vbd_refs = session.call_xenapi('VM.get_VBDs', vm_ref)
 vdi_refs = []
 if vbd_refs:
  for vbd_ref in vbd_refs:
   try:
    vdi_ref = session.call_xenapi('VBD.get_VDI', vbd_ref)
    vdi_uuid = session.call_xenapi('VDI.get_uuid', vdi_ref)
    LOG.debug('VDI %s is still available', vdi_uuid)
    vbd_other_config = session.call_xenapi('VBD.get_other_config', vbd_ref)
    if (not vbd_other_config.get('osvol')):
     vdi_refs.append(vdi_ref)
   except session.XenAPI.Failure:
    LOG.exception(_LE('"Look for the VDIs failed'))
 return vdi_refs

def lookup_vm_vdis ( session , vm_ref ) : vbd_refs = session . call_xenapi ( 'VM.get_VBDs' , vm_ref ) vdi_refs = [ ] if vbd_refs : for vbd_ref in vbd_refs : try : vdi_ref = session . call_xenapi ( 'VBD.get_VDI' , vbd_ref ) vdi_uuid = session . call_xenapi ( 'VDI.get_uuid' , vdi_ref ) LOG . debug ( 'VDI %s is still available' , vdi_uuid ) vbd_other_config = session . call_xenapi ( 'VBD.get_other_config' , vbd_ref ) if ( not vbd_other_config . get ( 'osvol' ) ) : vdi_refs . append ( vdi_ref ) except session . XenAPI . Failure : LOG . exception ( _LE ( '"Look for the VDIs failed' ) ) return vdi_refs
look for the vdis that are attached to the vm .