nova/nova/tests/functional/libvirt
Stephen Finucane 7ddab32767 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
(cherry picked from commit 9c27033204)
2020-08-26 15:49:51 +01:00
..
__init__.py tests: introduce a NUMAServersTest class 2015-04-16 11:43:53 -04:00
base.py libvirt: Don't delete disks on shared storage during evacuate 2020-06-10 00:05:07 +00:00
integrated_helpers.py Extract new base class for provider usage functional tests 2019-08-21 15:06:20 +01:00
test_evacuate.py libvirt: Don't delete disks on shared storage during evacuate 2020-06-10 00:05:07 +00:00
test_numa_servers.py hardware: Reject requests for no hyperthreads on hosts with HT 2020-08-26 15:49:51 +01:00
test_pci_sriov_servers.py functional: Add unified '_build_server' helper function 2020-01-15 10:31:24 +00:00
test_report_cpu_traits.py libvirt: Use domain capabilities to get supported device models 2020-03-24 17:28:09 +00:00
test_reshape.py Functional test with pGPUs 2020-04-09 17:54:31 +02:00
test_rt_servers.py functional: Add '_create_server' helper 2020-01-20 14:32:43 +00:00
test_shared_resource_provider.py functional: Add '_create_server' helper 2020-01-20 14:32:43 +00:00
test_vgpu.py Allocate mdevs when resizing or reverting resize 2020-04-20 14:48:16 +02:00
test_vpmem.py functional: Add '_create_server' helper 2020-01-20 14:32:43 +00:00