def get_host_ref(session, cluster=None):
 if (cluster is None):
  host_mor = session._call_method(vim_util, 'get_objects', 'HostSystem')[0].obj
 else:
  host_ret = session._call_method(vim_util, 'get_dynamic_property', cluster, 'ClusterComputeResource', 'host')
  if (host_ret is None):
   return
  if (not host_ret.ManagedObjectReference):
   return
  host_mor = host_ret.ManagedObjectReference[0]
 return host_mor

def get_host_ref ( session , cluster = None ) : if ( cluster is None ) : host_mor = session . _call_method ( vim_util , 'get_objects' , 'HostSystem' ) [ 0 ] . obj else : host_ret = session . _call_method ( vim_util , 'get_dynamic_property' , cluster , 'ClusterComputeResource' , 'host' ) if ( host_ret is None ) : return if ( not host_ret . ManagedObjectReference ) : return host_mor = host_ret . ManagedObjectReference [ 0 ] return host_mor
get reference to a host within the cluster specified .