Skip to content

Commit 4da0587

Browse files
committed
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 <[email protected]>
1 parent b01da49 commit 4da0587

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

nova/conductor/tasks/live_migrate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ def _check_instance_has_no_numa(self):
163163
# HyperV's vNUMA feature doesn't allow specific pinning
164164
hypervisor_type = objects.ComputeNode.get_by_host_and_nodename(
165165
self.context, self.source, self.instance.node).hypervisor_type
166-
if hypervisor_type != obj_fields.HVType.KVM:
166+
167+
# KVM is not a hypervisor, so when using a virt_type of "kvm" the
168+
# hypervisor_type will still be "QEMU".
169+
if hypervisor_type.lower() != obj_fields.HVType.QEMU:
167170
return
168171

169172
msg = ('Instance has an associated NUMA topology. '

nova/tests/unit/conductor/tasks/test_live_migrate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def test_check_instance_has_no_numa_passes_workaround(self, mock_get):
205205
def test_check_instance_has_no_numa_fails(self, mock_get):
206206
self.flags(enable_numa_live_migration=False, group='workarounds')
207207
mock_get.return_value = objects.ComputeNode(
208-
uuid=uuids.cn1, hypervisor_type='kvm')
208+
uuid=uuids.cn1, hypervisor_type='QEMU')
209209
self.task.instance.numa_topology = objects.InstanceNUMATopology(
210210
cells=[objects.InstanceNUMACell(id=0, cpuset=set([0]),
211211
memory=1024)])

0 commit comments

Comments
 (0)