Hello, I haven't investigated thoroughly but I suspect that the bare metal nodes returned from the hypervisor calls are not handled by the nova CDM just like you expect. I think we should look into if bare metal nodes are stored in the compute_model as I think it would more sense to filter them out. Overall I think the way Watcher handles bare metal nodes must be analysed and improved for example the saving energy strategy uses the ironic client directly and there is currently not a single strategy that accesses the baremetal_model. Maybe I have time to test my suspicions in a test environment with both ironic and hypervisor nodes next week. On 5/23/19 11:40 PM, Matt Riedemann wrote:
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