@@ -2258,6 +2258,7 @@ def _numa_cells_support_network_metadata(
2258
2258
required_tunnel = network_metadata .tunneled
2259
2259
2260
2260
if required_physnets :
2261
+ removed_physnets = False
2261
2262
# identify requested physnets that have an affinity to any of our
2262
2263
# chosen host NUMA cells
2263
2264
for host_cell in chosen_host_cells :
@@ -2268,6 +2269,12 @@ def _numa_cells_support_network_metadata(
2268
2269
# drop said physnet(s) from the list we're searching for
2269
2270
required_physnets -= required_physnets .intersection (
2270
2271
host_cell .network_metadata .physnets )
2272
+ removed_physnets = True
2273
+
2274
+ if required_physnets and removed_physnets :
2275
+ LOG .debug ('Not all requested physnets have affinity to one '
2276
+ 'of the chosen host NUMA cells. Remaining physnets '
2277
+ 'are: %(physnets)s.' , {'physnets' : required_physnets })
2271
2278
2272
2279
# however, if we still require some level of NUMA affinity, we need
2273
2280
# to make sure one of the other NUMA cells isn't providing that; note
@@ -2279,8 +2286,15 @@ def _numa_cells_support_network_metadata(
2279
2286
2280
2287
# if one of these cells provides affinity for one or more physnets,
2281
2288
# we need to fail because we should be using that node and are not
2282
- if required_physnets .intersection (
2283
- host_cell .network_metadata .physnets ):
2289
+ required_physnets_outside = required_physnets .intersection (
2290
+ host_cell .network_metadata .physnets )
2291
+
2292
+ if required_physnets_outside :
2293
+ LOG .debug ('One or more requested physnets require affinity to '
2294
+ 'a NUMA cell outside of the chosen host cells. This '
2295
+ 'host cell cannot satisfy network requests for '
2296
+ 'these physnets: %(physnets)s' ,
2297
+ {'physnets' : required_physnets_outside })
2284
2298
return False
2285
2299
2286
2300
if required_tunnel :
@@ -2293,6 +2307,9 @@ def _numa_cells_support_network_metadata(
2293
2307
if host_cell .network_metadata .tunneled :
2294
2308
return True
2295
2309
2310
+ LOG .debug ('Tunneled networks have no affinity to any of the chosen '
2311
+ 'host NUMA cells.' )
2312
+
2296
2313
# however, if we still require some level of NUMA affinity, we need to
2297
2314
# make sure one of the other NUMA cells isn't providing that; note
2298
2315
# that, as with physnets, NUMA affinity might not be defined for
@@ -2302,6 +2319,12 @@ def _numa_cells_support_network_metadata(
2302
2319
continue
2303
2320
2304
2321
if host_cell .network_metadata .tunneled :
2322
+ LOG .debug ('The host declares NUMA affinity for tunneled '
2323
+ 'networks. The current instance requests a '
2324
+ 'tunneled network but this host cell is out of '
2325
+ 'the set declared to be local to the tunnel '
2326
+ 'network endpoint. As such, this host cell cannot '
2327
+ 'support the requested tunneled network.' )
2305
2328
return False
2306
2329
2307
2330
return True
0 commit comments