[watcher] Question about baremetal node support in nova CDM

Matt Riedemann mriedemos at gmail.com
Thu May 23 21:40:17 UTC 2019


While working on [1] I noticed that the 
NovaHelper.get_compute_node_by_hostname method is making 3 API calls to 
get the details about a hypervisor:

1. listing hypervisors and then filtering client-side by the compute 
service host - this fails if there is not exactly one hypervisor for the 
given compute service host name

2. search for the hypervisor given the hypervisor_hostname to get the id

3. get the hypervisor details using the id

My patch is collapsing 2 and 3 into a single API call to nova.

The question I had was if we need that first call. For all non-ironic 
baremetal nodes, the compute service host and node hypervisor_hostname 
should be identical, so technically we could just search for the 
hypervisor details with the compute service hostname.

Only in the case of ironic would we potentially get more than one 
hypervisor (node) for a single compute service (host).

I don't think the nova CDM code really handles baremetal instances at 
all because it's not handling this kind of host:node 1:M cardinality 
elsewhere in the code, but you also can't do most things to optimize 
like cold or live migrating baremetal instances.

I'm not exactly sure how Watcher deals with ironic but I know there is 
the separate BaremetalClusterDataModelCollector so I'm assuming watcher 
just optimizes for baremetal outside of the nova compute API?

If this is true, then we can get rid of that first API all noted above 
and I don't need to write a nova spec to add a host filter parameter to 
the GET /os-hypervisors/detail API.

[1] https://review.opendev.org/#/c/661121/2/watcher/common/nova_helper.py@65

-- 

Thanks,

Matt



More information about the openstack-discuss mailing list