From dfef0a91096acc22053db513b22bc57a3efd4964 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Tue, 2 Jan 2018 13:52:30 -0500 Subject: [PATCH] Only call numa_fit_instance_to_host if necessary The numa_fit_instance_to_host method emits a debug message when there is no provided host or instance topology: "Require both a host and instance NUMA topology to fit instance on host" This can be confused with something that is wrong when most of the time it just means the request spec doesn't have a NUMA topology requirement. This change avoids calling the method altogether if there is no host and instance topology, just like in the NUMATopologyFilter. Change-Id: Iba0f616927dc44929df07a19f8f33d4cc07017d1 --- nova/scheduler/host_manager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nova/scheduler/host_manager.py b/nova/scheduler/host_manager.py index 53eb27c42858..f5646f0d9354 100644 --- a/nova/scheduler/host_manager.py +++ b/nova/scheduler/host_manager.py @@ -293,11 +293,11 @@ class HostState(object): host_numa_topology, _fmt = hardware.host_topology_and_format_from_host( self) instance_numa_topology = spec_obj.numa_topology - - spec_obj.numa_topology = hardware.numa_fit_instance_to_host( - host_numa_topology, instance_numa_topology, - limits=self.limits.get('numa_topology'), - pci_requests=pci_requests, pci_stats=self.pci_stats) + if host_numa_topology and instance_numa_topology: + spec_obj.numa_topology = hardware.numa_fit_instance_to_host( + host_numa_topology, instance_numa_topology, + limits=self.limits.get('numa_topology'), + pci_requests=pci_requests, pci_stats=self.pci_stats) if pci_requests: instance_cells = None if spec_obj.numa_topology: