diff --git a/nova/scheduler/ironic_host_manager.py b/nova/scheduler/ironic_host_manager.py index faee26a8f4..59f3839a4c 100644 --- a/nova/scheduler/ironic_host_manager.py +++ b/nova/scheduler/ironic_host_manager.py @@ -104,7 +104,7 @@ class IronicHostManager(host_manager.HostManager): def host_state_cls(self, host, node, **kwargs): """Factory function/property to create a new HostState.""" compute = kwargs.get('compute') - if compute and compute.get('cpu_info') == 'baremetal cpu': + if compute and compute.get('hypervisor_type') == 'ironic': return IronicNodeState(host, node, **kwargs) else: return host_manager.HostState(host, node, **kwargs) diff --git a/nova/tests/unit/scheduler/test_ironic_host_manager.py b/nova/tests/unit/scheduler/test_ironic_host_manager.py index 50ec038cb3..472e9dbf6e 100644 --- a/nova/tests/unit/scheduler/test_ironic_host_manager.py +++ b/nova/tests/unit/scheduler/test_ironic_host_manager.py @@ -108,7 +108,7 @@ class IronicHostManagerChangedNodesTestCase(test.NoDBTestCase): @mock.patch.object(ironic_host_manager.IronicNodeState, '__init__') def test_create_ironic_node_state(self, init_mock): init_mock.return_value = None - compute = {'cpu_info': 'baremetal cpu'} + compute = {'hypervisor_type': 'ironic'} host_state = self.host_manager.host_state_cls('fake-host', 'fake-node', compute=compute) self.assertIs(ironic_host_manager.IronicNodeState, type(host_state)) diff --git a/nova/virt/ironic/driver.py b/nova/virt/ironic/driver.py index c10df8b262..2136246779 100644 --- a/nova/virt/ironic/driver.py +++ b/nova/virt/ironic/driver.py @@ -254,7 +254,11 @@ class IronicDriver(virt_driver.ComputeDriver): 'hypervisor_hostname': str(node.uuid), 'hypervisor_type': self._get_hypervisor_type(), 'hypervisor_version': self._get_hypervisor_version(), - 'cpu_info': 'baremetal cpu', + # The Ironic driver manages multiple hosts, so there are + # likely many different CPU models in use. As such it is + # impossible to provide any meaningful info on the CPU + # model of the "host" + 'cpu_info': None, 'vcpus': vcpus, 'vcpus_used': vcpus_used, 'local_gb': local_gb,