summaryrefslogtreecommitdiff
path: root/nova/pci
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2020-11-26 17:43:04 +0000
committerStephen Finucane <stephenfin@redhat.com>2020-11-27 17:55:21 +0000
commitd81ef45041a0bf5d3122ce154b24bcf1546ae441 (patch)
tree6a1d47c6822d394d5ff4e62e8232fdd1cca24dc5 /nova/pci
parentc2357ab9f30e0f9a2c8d2831732abb3fda107058 (diff)
downloadnova-d81ef45041a0bf5d3122ce154b24bcf1546ae441.tar.gz
pci: Add logging for filtering
This is possibly quite noisy, but it should give some kind of breadcrumb to suggest why a host was rejected. It can be particularly beneficial for devices with SR-IOV devices, which as noted on bug #1852727 are filtered out by default. Change-Id: I67455d4ecfafed96cb0f3f9fbe6f94808bd05909 Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Related-Bug: #1852727
Diffstat (limited to 'nova/pci')
-rw-r--r--nova/pci/stats.py37
1 files changed, 35 insertions, 2 deletions
diff --git a/nova/pci/stats.py b/nova/pci/stats.py
index cb04fde058..5dd0ddfdee 100644
--- a/nova/pci/stats.py
+++ b/nova/pci/stats.py
@@ -371,19 +371,52 @@ class PciDeviceStats(object):
# Firstly, let's exclude all devices that don't match our spec (e.g.
# they've got different PCI IDs or something)
+ before_count = sum([pool['count'] for pool in pools])
pools = cls._filter_pools_for_spec(pools, request)
+ after_count = sum([pool['count'] for pool in pools])
+
+ if after_count < before_count:
+ LOG.debug(
+ 'Dropped %d devices due to mismatched PCI attribute(s)',
+ before_count - after_count
+ )
+
+ if after_count < request.count:
+ LOG.debug('Not enough PCI devices left to satify request')
+ return None
# Next, let's exclude all devices that aren't on the correct NUMA node
# *assuming* we have devices and care about that, as determined by
# policy
+ before_count = after_count
pools = cls._filter_pools_for_numa_cells(pools, request, numa_cells)
+ after_count = sum([pool['count'] for pool in pools])
+
+ if after_count < before_count:
+ LOG.debug(
+ 'Dropped %d devices as they are on the wrong NUMA node(s)',
+ before_count - after_count
+ )
+
+ if after_count < request.count:
+ LOG.debug('Not enough PCI devices left to satify request')
+ return None
# Finally, if we're not requesting PFs then we should not use these.
# Exclude them.
+ before_count = after_count
pools = cls._filter_pools_for_unrequested_pfs(pools, request)
+ after_count = sum([pool['count'] for pool in pools])
+
+ if after_count < before_count:
+ LOG.debug(
+ 'Dropped %d devices as they are PFs which we have not '
+ 'requested',
+ before_count - after_count
+ )
- # Do we still have enough devices left?
- if sum([pool['count'] for pool in pools]) < request.count:
+ if after_count < request.count:
+ LOG.debug('Not enough PCI devices left to satify request')
return None
return pools