[Openstack] [OpenStack][nova]host and node difference

Jay Lau jay.lau.513 at gmail.com
Wed Jun 26 16:52:43 UTC 2013


Hi,

I noticed that now in nova::host_manager.py, the function
get_all_host_states() is returnning constructing a state key with host and
node.

def get_all_host_states(self, context):
        """Returns a list of HostStates that represents all the hosts
        the HostManager knows about. Also, each of the consumable resources
        in HostState are pre-populated and adjusted based on data in the db.
        """

        # Get resource usage across the available compute nodes:
        compute_nodes = db.compute_node_get_all(context)
        seen_nodes = set()
        for compute in compute_nodes:
            service = compute['service']
            if not service:
                LOG.warn(_("No service for compute ID %s") % compute['id'])
                continue
            host = service['host']  <<<<<<<<
            node = compute.get('hypervisor_hostname') <<<<<<<<
            state_key = (host, node) <<<<<<<<

Can someone show me a case when host and node are different?

Thanks,

Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130627/2d155383/attachment.html>


More information about the Openstack mailing list