diff options
Diffstat (limited to 'nova/scheduler/filters/numa_topology_filter.py')
-rw-r--r-- | nova/scheduler/filters/numa_topology_filter.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/nova/scheduler/filters/numa_topology_filter.py b/nova/scheduler/filters/numa_topology_filter.py index 74d6012f82..ae50db90e5 100644 --- a/nova/scheduler/filters/numa_topology_filter.py +++ b/nova/scheduler/filters/numa_topology_filter.py @@ -20,7 +20,10 @@ from nova.virt import hardware LOG = logging.getLogger(__name__) -class NUMATopologyFilter(filters.BaseHostFilter): +class NUMATopologyFilter( + filters.BaseHostFilter, + filters.CandidateFilterMixin, +): """Filter on requested NUMA topology.""" # NOTE(sean-k-mooney): In change I0322d872bdff68936033a6f5a54e8296a6fb343 @@ -97,12 +100,19 @@ class NUMATopologyFilter(filters.BaseHostFilter): if network_metadata: limits.network_metadata = network_metadata - instance_topology = (hardware.numa_fit_instance_to_host( - host_topology, requested_topology, - limits=limits, - pci_requests=pci_requests, - pci_stats=host_state.pci_stats)) - if not instance_topology: + good_candidates = self.filter_candidates( + host_state, + lambda candidate: hardware.numa_fit_instance_to_host( + host_topology, + requested_topology, + limits=limits, + pci_requests=pci_requests, + pci_stats=host_state.pci_stats, + provider_mapping=candidate["mappings"], + ), + ) + + if not good_candidates: LOG.debug("%(host)s, %(node)s fails NUMA topology " "requirements. The instance does not fit on this " "host.", {'host': host_state.host, |