summaryrefslogtreecommitdiff
path: root/nova/tests/functional/libvirt/test_numa_servers.py
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2020-07-30 17:36:24 +0100
committerStephen Finucane <stephenfin@redhat.com>2020-07-31 13:30:17 +0100
commit9c270332041d6b98951c0b57d7b344fd551a413c (patch)
tree81246faac7f1d58c33b4148d1e81318253c9ce6d /nova/tests/functional/libvirt/test_numa_servers.py
parent737e0c0111acd364d1481bdabd9d23bc8d5d6a2e (diff)
downloadnova-9c270332041d6b98951c0b57d7b344fd551a413c.tar.gz
hardware: Reject requests for no hyperthreads on hosts with HT
Attempting to boot an instance with 'hw:cpu_policy=dedicated' will result in a request from nova-scheduler to placement for allocation candidates with $flavor.vcpu 'PCPU' inventory. Similarly, booting an instance with 'hw:cpu_thread_policy=isolate' will result in a request for allocation candidates with 'HW_CPU_HYPERTHREADING=forbidden', i.e. hosts without hyperthreading. This has been the case since the cpu-resources feature was implemented in Train. However, as part of that work and to enable upgrades from hosts that predated Train, we also make a second request for candidates with $flavor.vcpu 'VCPU' inventory. The idea behind this is that old compute nodes would only report 'VCPU' and should be useable, and any new compute nodes that got caught up in this second request could never actually be scheduled to since there wouldn't be enough cores from 'ComputeNode.numa_topology.cells.[*].pcpuset' available to schedule to, resulting in rejection by the 'NUMATopologyFilter'. However, if a host was rejected in the first query because it reported the 'HW_CPU_HYPERTHREADING' trait, it could get picked up by the second query and would happily be scheduled to, resulting in an instance consuming 'VCPU' inventory from a host that properly supported 'PCPU' inventory. The solution is simply, though also a huge hack. If we detect that the host is using new style configuration and should be able to report 'PCPU', check if the instance asked for no hyperthreading and whether the host has it. If all are True, reject the request. Change-Id: Id39aaaac09585ca1a754b669351c86e234b89dd9 Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Closes-Bug: #1889633
Diffstat (limited to 'nova/tests/functional/libvirt/test_numa_servers.py')
-rw-r--r--nova/tests/functional/libvirt/test_numa_servers.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/nova/tests/functional/libvirt/test_numa_servers.py b/nova/tests/functional/libvirt/test_numa_servers.py
index aba72647eb..2eb6790614 100644
--- a/nova/tests/functional/libvirt/test_numa_servers.py
+++ b/nova/tests/functional/libvirt/test_numa_servers.py
@@ -383,12 +383,7 @@ class NUMAServersTest(NUMAServersTestBase):
}
flavor_id = self._create_flavor(vcpu=2, extra_spec=extra_spec)
- # FIXME(stephenfin): This should go to error status since there should
- # not be a host available
- expected_usage = {
- 'DISK_GB': 20, 'MEMORY_MB': 2048, 'PCPU': 0, 'VCPU': 2,
- }
- self._run_build_test(flavor_id, expected_usage=expected_usage)
+ self._run_build_test(flavor_id, end_status='ERROR')
def test_create_server_with_pcpu(self):
"""Create a server using an explicit 'resources:PCPU' request.