'Get reference to the host with the name specified.'

def _get_host_ref_from_name(self, host_name):

    host_objs = self._session._call_method(vim_util, 'get_objects', 'HostSystem', ['name'])
    vm_util._cancel_retrieve_if_necessary(self._session, host_objs)
    for host in host_objs:
        if hasattr(host, 'propSet'):
            if (host.propSet[0].val == host_name):
                return host.obj
    return None
