def _get_vm_ref_from_vm_uuid(session, instance_uuid):
 vm_refs = session._call_method(session.vim, 'FindAllByUuid', session.vim.service_content.searchIndex, uuid=instance_uuid, vmSearch=True, instanceUuid=True)
 if vm_refs:
  return vm_refs[0]

def _get_vm_ref_from_vm_uuid ( session , instance_uuid ) : vm_refs = session . _call_method ( session . vim , 'FindAllByUuid' , session . vim . service_content . searchIndex , uuid = instance_uuid , vmSearch = True , instanceUuid = True ) if vm_refs : return vm_refs [ 0 ]
get reference to the vm .