def is_booted_from_volume(session, vm_ref):
 vbd_ref = find_vbd_by_number(session, vm_ref, 0)
 vbd_other_config = session.VBD.get_other_config(vbd_ref)
 if vbd_other_config.get('osvol', False):
  return True
 return False

def is_booted_from_volume ( session , vm_ref ) : vbd_ref = find_vbd_by_number ( session , vm_ref , 0 ) vbd_other_config = session . VBD . get_other_config ( vbd_ref ) if vbd_other_config . get ( 'osvol' , False ) : return True return False
determine if the root device is a volume .