'Get hosts in the given cluster.
:param cluster: cluster reference
:return: references to hosts in the cluster'

def get_cluster_hosts(self, cluster):

    hosts = self._session.invoke_api(vim_util, 'get_object_property', self._session.vim, cluster, 'host')
    host_refs = []
    if (hosts and hosts.ManagedObjectReference):
        host_refs.extend(hosts.ManagedObjectReference)
    return host_refs
