Skip to content

Commit 4327363

Browse files
jsanemetmelwitt
authored andcommitted
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 (cherry picked from commit 1915a31) (cherry picked from commit 0d970bf)
1 parent b5e4390 commit 4327363

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

nova/virt/hardware.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,6 +2253,7 @@ def _numa_cells_support_network_metadata(
22532253
required_tunnel = network_metadata.tunneled
22542254

22552255
if required_physnets:
2256+
removed_physnets = False
22562257
# identify requested physnets that have an affinity to any of our
22572258
# chosen host NUMA cells
22582259
for host_cell in chosen_host_cells:
@@ -2263,6 +2264,12 @@ def _numa_cells_support_network_metadata(
22632264
# drop said physnet(s) from the list we're searching for
22642265
required_physnets -= required_physnets.intersection(
22652266
host_cell.network_metadata.physnets)
2267+
removed_physnets = True
2268+
2269+
if required_physnets and removed_physnets:
2270+
LOG.debug('Not all requested physnets have affinity to one '
2271+
'of the chosen host NUMA cells. Remaining physnets '
2272+
'are: %(physnets)s.', {'physnets': required_physnets})
22662273

22672274
# however, if we still require some level of NUMA affinity, we need
22682275
# to make sure one of the other NUMA cells isn't providing that; note
@@ -2274,8 +2281,15 @@ def _numa_cells_support_network_metadata(
22742281

22752282
# if one of these cells provides affinity for one or more physnets,
22762283
# we need to fail because we should be using that node and are not
2277-
if required_physnets.intersection(
2278-
host_cell.network_metadata.physnets):
2284+
required_physnets_outside = required_physnets.intersection(
2285+
host_cell.network_metadata.physnets)
2286+
2287+
if required_physnets_outside:
2288+
LOG.debug('One or more requested physnets require affinity to '
2289+
'a NUMA cell outside of the chosen host cells. This '
2290+
'host cell cannot satisfy network requests for '
2291+
'these physnets: %(physnets)s',
2292+
{'physnets': required_physnets_outside})
22792293
return False
22802294

22812295
if required_tunnel:
@@ -2288,6 +2302,9 @@ def _numa_cells_support_network_metadata(
22882302
if host_cell.network_metadata.tunneled:
22892303
return True
22902304

2305+
LOG.debug('Tunneled networks have no affinity to any of the chosen '
2306+
'host NUMA cells.')
2307+
22912308
# however, if we still require some level of NUMA affinity, we need to
22922309
# make sure one of the other NUMA cells isn't providing that; note
22932310
# that, as with physnets, NUMA affinity might not be defined for
@@ -2297,6 +2314,12 @@ def _numa_cells_support_network_metadata(
22972314
continue
22982315

22992316
if host_cell.network_metadata.tunneled:
2317+
LOG.debug('The host declares NUMA affinity for tunneled '
2318+
'networks. The current instance requests a '
2319+
'tunneled network but this host cell is out of '
2320+
'the set declared to be local to the tunnel '
2321+
'network endpoint. As such, this host cell cannot '
2322+
'support the requested tunneled network.')
23002323
return False
23012324

23022325
return True

0 commit comments

Comments
 (0)