nova/nova/tests/unit/virt
Stephen Finucane 9c27033204 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
2020-07-31 13:30:17 +01:00
..
disk lxc: make use of filter python3 compatible 2019-08-13 22:29:57 +00:00
hyperv objects: Introduce 'pcpuset' field for InstanceNUMACell 2020-07-14 00:38:34 +08:00
image
ironic virt: Add 'context', drop 'network_info' parameters for 'unrescue' 2020-07-08 11:56:01 +01:00
libvirt Merge "Handle multiple 'vcpusched' elements during live migrate" 2020-07-29 19:31:29 +00:00
powervm Remove future imports 2020-03-24 15:05:36 +00:00
vmwareapi Bump hacking min version to 3.1.0 2020-05-19 08:09:43 +08:00
xenapi virt: Add 'context', drop 'network_info' parameters for 'unrescue' 2020-07-08 11:56:01 +01:00
zvm set default value to 0 instead of '' 2020-02-11 10:01:37 +00:00
__init__.py
fakelibosinfo.py Stop sending bad values from libosinfo to libvirt 2019-07-04 15:30:51 +01:00
test_block_device.py block_device: Copy original volume_type when missing for snapshot based volumes 2019-11-21 18:13:04 +00:00
test_configdrive.py Skip existing VMs when hosts apply force_config_drive 2019-05-22 21:02:16 +00:00
test_driver.py
test_events.py
test_fake.py
test_hardware.py hardware: Reject requests for no hyperthreads on hosts with HT 2020-07-31 13:30:17 +01:00
test_imagecache.py Consolidate [image_cache] conf options 2019-11-13 11:09:03 -06:00
test_images.py images: Make JSON the default output format of calls to qemu-img info 2020-04-16 16:38:24 +01:00
test_netutils.py
test_osinfo.py Stop sending bad values from libosinfo to libvirt 2019-07-04 15:30:51 +01:00
test_virt.py We no longer need rootwrap. 2019-02-27 05:06:31 +00:00
test_virt_drivers.py libvirt: Simplify '_create_domain' function 2020-07-16 17:46:55 +01:00