nova/nova/tests/functional
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
..
api api: Add microversion for extra spec validation 2020-04-08 13:20:02 +00:00
api_sample_tests tests: Define constants in '_IntegratedTestBase' 2020-07-16 17:58:36 +01:00
compute func: Add live migration rollback volume attachment tests 2020-07-29 10:42:21 +01:00
db Merge "tests: Remove 'test_servers.ServersTestBase'" 2020-07-24 09:24:53 +00:00
libvirt hardware: Reject requests for no hyperthreads on hosts with HT 2020-07-31 13:30:17 +01:00
notification_sample_tests Merge "scheduler: Request vTPM trait based on flavor or image" 2020-07-24 09:23:54 +00:00
regressions Add regression tests for bug #1889108 2020-07-29 10:54:40 +01:00
wsgi tests: Remove 'test_servers.ServersTestBase' 2020-07-16 17:58:37 +01:00
__init__.py Eventlet monkey patching should be as early as possible 2019-03-22 09:27:16 +00:00
api_paste_fixture.py Remove future imports 2020-03-24 15:05:36 +00:00
api_samples_test_base.py tests: Define constants in '_IntegratedTestBase' 2020-07-16 17:58:36 +01:00
fixtures.py Remove future imports 2020-03-24 15:05:36 +00:00
integrated_helpers.py tests: Make '_IntegratedTestBase' subclass 'PlacementInstanceHelperMixin' 2020-07-16 17:58:37 +01:00
test_aggregates.py func tests: move _run_periodics() into base class 2020-03-24 10:10:53 -04:00
test_availability_zones.py functional: Add unified '_build_server' helper function 2020-01-15 10:31:24 +00:00
test_boot_from_volume.py tests: Remove 'test_servers.ServersTestBase' 2020-07-16 17:58:37 +01:00
test_cold_migrate.py Use COMPUTE_SAME_HOST_COLD_MIGRATE trait during migrate 2020-01-29 09:44:47 +00:00
test_compute_mgr.py Remove future imports 2020-03-24 15:05:36 +00:00
test_conf_max_attach_disk_devices.py tests: Remove 'test_servers.ServersTestBase' 2020-07-16 17:58:37 +01:00
test_cross_az_attach.py functional: Add unified '_build_server' helper function 2020-01-15 10:31:24 +00:00
test_cross_cell_migrate.py trivial: Use recognized extra specs in tests 2020-02-19 08:24:31 +00:00
test_external_networks.py functional: Add unified '_build_server' helper function 2020-01-15 10:31:24 +00:00
test_flavor_extraspecs.py Follow-up for flavor-extra-spec-validators series 2020-04-08 14:21:13 +01:00
test_images.py tests: Remove 'test_servers.ServersTestBase' 2020-07-16 17:58:37 +01:00
test_instance_actions.py tests: Remove 'test_servers.ServersTestBase' 2020-07-16 17:58:37 +01:00
test_json_filter.py functional: Add unified '_build_server' helper function 2020-01-15 10:31:24 +00:00
test_legacy_v2_compatible_wrapper.py tests: Remove 'test_servers.ServersTestBase' 2020-07-16 17:58:37 +01:00
test_list_servers_ip_filter.py trivial: Change name of network provided by NeutronFixture 2019-10-05 15:40:28 +01:00
test_login.py update api_samples code to use better variables 2015-12-14 11:23:26 +08:00
test_metadata.py Remove future imports 2020-03-24 15:05:36 +00:00
test_middleware.py tests: Define constants in '_IntegratedTestBase' 2020-07-16 17:58:36 +01:00
test_multiattach.py tests: Remove 'test_servers.ServersTestBase' 2020-07-16 17:58:37 +01:00
test_nova_manage.py tests: Remove 'test_servers.ServersTestBase' 2020-07-16 17:58:37 +01:00
test_policy.py Follow-ups for host_status:unknown-only policy rule 2020-03-16 17:18:28 +00:00
test_report_client.py Stop using PlacementDirect 2020-03-05 07:36:37 -06:00
test_scheduler.py func tests: move _run_periodics() into base class 2020-03-24 10:10:53 -04:00
test_server_external_events.py functional: Add unified '_build_server' helper function 2020-01-15 10:31:24 +00:00
test_server_faults.py functional: Add unified '_build_server' helper function 2020-01-15 10:31:24 +00:00
test_server_group.py Merge "Update scheduler instance info at confirm resize" 2020-05-16 00:19:46 +00:00
test_server_rescue.py api: Introduce microverion 2.87 allowing boot from volume rescue 2020-04-09 08:39:36 +01:00
test_servers.py tests: Remove 'test_servers.ServersTestBase' 2020-07-16 17:58:37 +01:00
test_servers_provider_tree.py Merge "tests: Move single use constants to their callers" 2020-07-24 09:24:35 +00:00
test_service.py Reset the cell cache for database access in Service 2020-04-08 17:48:18 +00:00