nova/nova/scheduler
Stephen Finucane 278ab01c32 Add support for translating CPU policy extra specs, image meta
Map 'hw:cpu_policy' and 'hw:cpu_thread_policy' as follows:

  hw:cpu_policy
    dedicated -> resources:PCPU=${flavor.vcpus}
    shared    -> resources:VCPU=${flavor.vcpus}

  hw:cpu_thread_policy
    isolate -> trait:HW_CPU_HYPERTHREADING:forbidden
    require -> trait:HW_CPU_HYPERTHREADING:required
    prefer  -> (none, handled later during scheduling)

Ditto for the 'hw_cpu_policy' and 'hw_cpu_thread_policy' image metadata
equivalents.

In addition, increment the requested 'resources:PCPU' by 1 if the
'hw:emulator_threads_policy' extra spec is present and set to 'isolate'.

The scheduler will attempt to get PCPUs allocations and fall back to
VCPUs if that fails. This is okay because the NUMA fitting code from the
'hardware' module used by both the 'NUMATopology' filter and libvirt
driver protects us. That code doesn't know anything about PCPUs or VCPUs
but rather cares about the 'NUMATopology.pcpuset' field, (starting in
change I492803eaacc34c69af073689f9159449557919db), which can be set to
different values depending on whether this is Train with new-style
config, Train with old-style config, or Stein:

- For Train compute nodes with new-style config, 'NUMATopology.pcpuset'
  will be explictly set to the value of '[compute] cpu_dedicated_set'
  or, if only '[compute] cpu_dedicated_set' is configured, 'None' (it's
  nullable) by the virt driver so the calls to
  'hardware.numa_fit_instance_to_host' in the 'NUMATopologyFilter' or
  virt driver will fail if it can't actually fit.

- For Train compute nodes with old-style config, 'NUMATopology.pcpuset'
  will be set to the same value as 'NUMATopology.cpuset' by the virt
  driver.

- For Stein compute nodes, 'NUMATopology.pcpuset' will be unset and
  we'll detect this in 'hardware.numa_fit_instance_to_host' and simply
  set it to the same value as 'NUMATopology.cpuset'.

Part of blueprint cpu-resources

Change-Id: Ie38aa625dff543b5980fd437ad2febeba3b50079
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-09-18 00:21:10 +01:00
..
client Include both VCPU and PCPU in core quota count 2019-09-18 00:21:10 +01:00
filters Merge "Remove 'hardware.host_topology_and_format_from_host'" 2019-08-23 16:23:31 +00:00
weights hacking: Resolve W503 (line break occurred before a binary operator) 2019-06-24 14:24:06 -05:00
__init__.py Improve hacking rule to avoid author markers 2014-05-05 14:35:20 +02:00
driver.py Remove the CachingScheduler 2018-10-18 17:55:36 -04:00
filter_scheduler.py Remove old comments about caching scheduler compat 2019-09-05 17:20:49 -04:00
host_manager.py Change HostManager to allow scheduling to other cells 2019-08-27 14:26:33 -04:00
manager.py Add support for translating CPU policy extra specs, image meta 2019-09-18 00:21:10 +01:00
request_filter.py Add a new request filter to isolate aggregates 2019-09-12 16:56:32 -05:00
rpcapi.py Use long_rpc_timeout in select_destinations RPC call 2018-11-20 09:03:53 -05:00
utils.py Add support for translating CPU policy extra specs, image meta 2019-09-18 00:21:10 +01:00