diff options
author | Chris Friesen <chris.friesen@windriver.com> | 2019-02-06 14:57:12 -0600 |
---|---|---|
committer | Matt Riedemann <mriedem.os@gmail.com> | 2019-07-02 14:25:41 +0000 |
commit | 9cbd2aeddec61c58aad5fd3efcf16c65612d2db7 (patch) | |
tree | 6495e4dd9288c7f54109b5330abb6443426b2093 | |
parent | 9999bce00f5bea5f3e90ab9e16625d4237504bcb (diff) | |
download | nova-9cbd2aeddec61c58aad5fd3efcf16c65612d2db7.tar.gz |
fix up numa-topology live migration hypervisor check
It turns out that even when KVM is supported by qemu the libvirt
driver will report the hypervisor type as "QEMU". So we need to
fix up the hypervisor type check in the live migration code that
checks whether the instance has a NUMA topology.
Closes-Bug: #1818092
Change-Id: I5127227a1e3d76dd413a820b048547ba578aff6b
Signed-off-by: Chris Friesen <chris.friesen@windriver.com>
(cherry picked from commit 4da058723332a58323640fabce3d95902946a07d)
(cherry picked from commit ecdf3c67ee464139d8a6f9cb8d332857f261228b)
-rw-r--r-- | nova/conductor/tasks/live_migrate.py | 5 | ||||
-rw-r--r-- | nova/tests/unit/conductor/tasks/test_live_migrate.py | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/nova/conductor/tasks/live_migrate.py b/nova/conductor/tasks/live_migrate.py index 07b183f706..0cb7d45271 100644 --- a/nova/conductor/tasks/live_migrate.py +++ b/nova/conductor/tasks/live_migrate.py @@ -152,7 +152,10 @@ class LiveMigrationTask(base.TaskBase): # HyperV's vNUMA feature doesn't allow specific pinning hypervisor_type = objects.ComputeNode.get_by_host_and_nodename( self.context, self.source, self.instance.node).hypervisor_type - if hypervisor_type != obj_fields.HVType.KVM: + + # KVM is not a hypervisor, so when using a virt_type of "kvm" the + # hypervisor_type will still be "QEMU". + if hypervisor_type.lower() != obj_fields.HVType.QEMU: return msg = ('Instance has an associated NUMA topology. ' diff --git a/nova/tests/unit/conductor/tasks/test_live_migrate.py b/nova/tests/unit/conductor/tasks/test_live_migrate.py index 498939954d..8647523f8a 100644 --- a/nova/tests/unit/conductor/tasks/test_live_migrate.py +++ b/nova/tests/unit/conductor/tasks/test_live_migrate.py @@ -210,7 +210,7 @@ class LiveMigrationTaskTestCase(test.NoDBTestCase): def test_check_instance_has_no_numa_fails(self, mock_get): self.flags(enable_numa_live_migration=False, group='workarounds') mock_get.return_value = objects.ComputeNode( - uuid=uuids.cn1, hypervisor_type='kvm') + uuid=uuids.cn1, hypervisor_type='QEMU') self.task.instance.numa_topology = objects.InstanceNUMATopology( cells=[objects.InstanceNUMACell(id=0, cpuset=set([0]), memory=1024)]) |