def get_disks(vm_):
 with _get_xapi_session() as xapi:
  disk = {}
  vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
  if (vm_uuid is False):
   return False
  for vbd in xapi.VM.get_VBDs(vm_uuid):
   dev = xapi.VBD.get_device(vbd)
   if (not dev):
    continue
   prop = xapi.VBD.get_runtime_properties(vbd)
   disk[dev] = {'backend': prop['backend'], 'type': prop['device-type'], 'protocol': prop['protocol']}
  return disk

def get_disks ( vm_ ) : with _get_xapi_session ( ) as xapi : disk = { } vm_uuid = _get_label_uuid ( xapi , 'VM' , vm_ ) if ( vm_uuid is False ) : return False for vbd in xapi . VM . get_VBDs ( vm_uuid ) : dev = xapi . VBD . get_device ( vbd ) if ( not dev ) : continue prop = xapi . VBD . get_runtime_properties ( vbd ) disk [ dev ] = { 'backend' : prop [ 'backend' ] , 'type' : prop [ 'device-type' ] , 'protocol' : prop [ 'protocol' ] } return disk
return the disks of a named vm cli example: .