diff options
author | Balazs Gibizer <gibi@redhat.com> | 2022-08-19 12:24:42 +0200 |
---|---|---|
committer | Balazs Gibizer <gibi@redhat.com> | 2022-10-17 13:56:18 +0200 |
commit | f1d82c0d0a0ef5932bb1e25120015c1099f03d18 (patch) | |
tree | d1c3d54a398940b2c381555e0abfada6bebe7595 /nova/virt | |
parent | 3d818c3473cdd94cac846309b555b771243f82b8 (diff) | |
download | nova-f1d82c0d0a0ef5932bb1e25120015c1099f03d18.tar.gz |
Filter PCI pools based on Placement allocation
The stats module is used to decide if the InstancePCIRequests of a boot
request can fit to a given compute host and to decide which PCI device
pool can fulfill the requests. It is used both during scheduling and also
during the PCI claim code.
PCI devices now modelled in placement and the allocation_candidate query
now requests PCI resources therefore each allocation candidate returned
from placement already restricts which PCI devices can be used during
the PciPassthroughFilter, the NumaTopologyFilter, and PCI claim code
paths. This patch adapts the stats module to consider the PCI
allocation candidate or the already made placement PCI allocation when
filtering the PCI device pools.
blueprint: pci-device-tracking-in-placement
Change-Id: If363981c4aeeb09a96ee94b140070d3d0f6af48f
Diffstat (limited to 'nova/virt')
-rw-r--r-- | nova/virt/hardware.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/nova/virt/hardware.py b/nova/virt/hardware.py index 271a719aa2..96a7198db2 100644 --- a/nova/virt/hardware.py +++ b/nova/virt/hardware.py @@ -2295,6 +2295,7 @@ def _numa_cells_support_network_metadata( def numa_fit_instance_to_host( host_topology: 'objects.NUMATopology', instance_topology: 'objects.InstanceNUMATopology', + provider_mapping: ty.Optional[ty.Dict[str, ty.List[str]]], limits: ty.Optional['objects.NUMATopologyLimit'] = None, pci_requests: ty.Optional['objects.InstancePCIRequests'] = None, pci_stats: ty.Optional[stats.PciDeviceStats] = None, @@ -2310,6 +2311,12 @@ def numa_fit_instance_to_host( :param host_topology: objects.NUMATopology object to fit an instance on :param instance_topology: objects.InstanceNUMATopology to be fitted + :param provider_mapping: A dict keyed by RequestGroup requester_id, + to a list of resource provider UUIDs which provide resource + for that RequestGroup. If it is None then it signals that the + InstancePCIRequest objects already stores a mapping per request. + I.e.: we are called _after_ the scheduler made allocations for this + request in placement. :param limits: objects.NUMATopologyLimits that defines limits :param pci_requests: instance pci_requests :param pci_stats: pci_stats for the host @@ -2465,7 +2472,7 @@ def numa_fit_instance_to_host( continue if pci_requests and pci_stats and not pci_stats.support_requests( - pci_requests, chosen_instance_cells): + pci_requests, provider_mapping, chosen_instance_cells): continue if network_metadata and not _numa_cells_support_network_metadata( |