From 1915a3122a1df1f0dbe5edbaf25919f8875733af Mon Sep 17 00:00:00 2001 From: Jorge San Emeterio Date: Tue, 11 Oct 2022 10:48:56 +0200 Subject: [PATCH] Improve logging at '_numa_cells_support_network_metadata' This adds 'debug' level messages at the branches of the function that lead to a 'False' result. These branches are: - Physnet found affinity on a NUMA cell outside the chosen ones - Tunneled networks found affinity on a NUMA cell outside the chosen ones Partial-Bug: #1751784 Change-Id: I4d45f383b3c4794f8a114047455efb764f60f2a2 --- nova/virt/hardware.py | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/nova/virt/hardware.py b/nova/virt/hardware.py index 271a719aa2..a8ae0dfe60 100644 --- a/nova/virt/hardware.py +++ b/nova/virt/hardware.py @@ -2243,6 +2243,7 @@ def _numa_cells_support_network_metadata( required_tunnel = network_metadata.tunneled if required_physnets: + removed_physnets = False # identify requested physnets that have an affinity to any of our # chosen host NUMA cells for host_cell in chosen_host_cells: @@ -2253,6 +2254,12 @@ def _numa_cells_support_network_metadata( # drop said physnet(s) from the list we're searching for required_physnets -= required_physnets.intersection( host_cell.network_metadata.physnets) + removed_physnets = True + + if required_physnets and removed_physnets: + LOG.debug('Not all requested physnets have affinity to one ' + 'of the chosen host NUMA cells. Remaining physnets ' + 'are: %(physnets)s.', {'physnets': required_physnets}) # however, if we still require some level of NUMA affinity, we need # to make sure one of the other NUMA cells isn't providing that; note @@ -2264,8 +2271,15 @@ def _numa_cells_support_network_metadata( # if one of these cells provides affinity for one or more physnets, # we need to fail because we should be using that node and are not - if required_physnets.intersection( - host_cell.network_metadata.physnets): + required_physnets_outside = required_physnets.intersection( + host_cell.network_metadata.physnets) + + if required_physnets_outside: + LOG.debug('One or more requested physnets require affinity to ' + 'a NUMA cell outside of the chosen host cells. This ' + 'host cell cannot satisfy network requests for ' + 'these physnets: %(physnets)s', + {'physnets': required_physnets_outside}) return False if required_tunnel: @@ -2278,6 +2292,9 @@ def _numa_cells_support_network_metadata( if host_cell.network_metadata.tunneled: return True + LOG.debug('Tunneled networks have no affinity to any of the chosen ' + 'host NUMA cells.') + # however, if we still require some level of NUMA affinity, we need to # make sure one of the other NUMA cells isn't providing that; note # that, as with physnets, NUMA affinity might not be defined for @@ -2287,6 +2304,12 @@ def _numa_cells_support_network_metadata( continue if host_cell.network_metadata.tunneled: + LOG.debug('The host declares NUMA affinity for tunneled ' + 'networks. The current instance requests a ' + 'tunneled network but this host cell is out of ' + 'the set declared to be local to the tunnel ' + 'network endpoint. As such, this host cell cannot ' + 'support the requested tunneled network.') return False return True