Skip to content

Commit 13ba896

Browse files
authored
Merge pull request #33 from stackhpc/upstream/xena-2023-02-13
Synchronise xena with upstream
2 parents c7c65d4 + f25cebf commit 13ba896

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

.zuul.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
description: |
9494
Run tempest live migration tests against local qcow2 ephemeral storage
9595
and shared LVM/iSCSI cinder volumes.
96-
irrelevant-files: &nova-base-irrelevant-files
96+
irrelevant-files:
9797
- ^api-.*$
9898
- ^(test-|)requirements.txt$
9999
- ^.*\.rst$
@@ -104,6 +104,7 @@
104104
- ^nova/policies/.*$
105105
- ^nova/tests/.*$
106106
- ^nova/test.py$
107+
- ^nova/virt/ironic/.*$
107108
- ^releasenotes/.*$
108109
- ^setup.cfg$
109110
- ^tools/.*$
@@ -136,7 +137,21 @@
136137
the "iptables_hybrid" securitygroup firewall driver, aka "hybrid plug".
137138
The external events interactions between Nova and Neutron in these
138139
situations has historically been fragile. This job exercises them.
139-
irrelevant-files: *nova-base-irrelevant-files
140+
irrelevant-files: &nova-base-irrelevant-files
141+
- ^api-.*$
142+
- ^(test-|)requirements.txt$
143+
- ^.*\.rst$
144+
- ^.git.*$
145+
- ^doc/.*$
146+
- ^nova/hacking/.*$
147+
- ^nova/locale/.*$
148+
- ^nova/policies/.*$
149+
- ^nova/tests/.*$
150+
- ^nova/test.py$
151+
- ^releasenotes/.*$
152+
- ^setup.cfg$
153+
- ^tools/.*$
154+
- ^tox.ini$
140155
vars:
141156
tox_envlist: all
142157
tempest_test_regex: (^tempest\..*compute\..*(migration|resize|reboot).*)

nova/virt/libvirt/driver.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7886,6 +7886,7 @@ def _get_existing_mdevs_not_assigned(self, parent, requested_types=None):
78867886
:param requested_types: Filter out the result for only mediated devices
78877887
having those types.
78887888
"""
7889+
LOG.debug('Searching for available mdevs...')
78897890
allocated_mdevs = self._get_all_assigned_mediated_devices()
78907891
mdevs = self._get_mediated_devices(requested_types)
78917892
available_mdevs = set()
@@ -7901,6 +7902,7 @@ def _get_existing_mdevs_not_assigned(self, parent, requested_types=None):
79017902
available_mdevs.add(mdev["uuid"])
79027903

79037904
available_mdevs -= set(allocated_mdevs)
7905+
LOG.info('Available mdevs at: %s.', available_mdevs)
79047906
return available_mdevs
79057907

79067908
def _create_new_mediated_device(self, parent, uuid=None):
@@ -7912,6 +7914,7 @@ def _create_new_mediated_device(self, parent, uuid=None):
79127914

79137915
:returns: the newly created mdev UUID or None if not possible
79147916
"""
7917+
LOG.debug('Attempting to create new mdev...')
79157918
supported_types = self.supported_vgpu_types
79167919
# Try to see if we can still create a new mediated device
79177920
devices = self._get_mdev_capable_devices(supported_types)
@@ -7923,6 +7926,7 @@ def _create_new_mediated_device(self, parent, uuid=None):
79237926
# The device is not the one that was called, not creating
79247927
# the mdev
79257928
continue
7929+
LOG.debug('Trying on: %s.', dev_name)
79267930
dev_supported_type = self._get_vgpu_type_per_pgpu(dev_name)
79277931
if dev_supported_type and device['types'][
79287932
dev_supported_type]['availableInstances'] > 0:
@@ -7932,7 +7936,13 @@ def _create_new_mediated_device(self, parent, uuid=None):
79327936
pci_addr = "{}:{}:{}.{}".format(*dev_name[4:].split('_'))
79337937
chosen_mdev = nova.privsep.libvirt.create_mdev(
79347938
pci_addr, dev_supported_type, uuid=uuid)
7939+
LOG.info('Created mdev: %s on pGPU: %s.',
7940+
chosen_mdev, pci_addr)
79357941
return chosen_mdev
7942+
LOG.debug('Failed: No available instances on device.')
7943+
LOG.info('Failed to create mdev. '
7944+
'No free space found among the following devices: %s.',
7945+
[dev['dev_id'] for dev in devices])
79367946

79377947
@utils.synchronized(VGPU_RESOURCE_SEMAPHORE)
79387948
def _allocate_mdevs(self, allocations):
@@ -8015,13 +8025,16 @@ def _allocate_mdevs(self, allocations):
80158025
# Take the first available mdev
80168026
chosen_mdev = mdevs_available.pop()
80178027
else:
8028+
LOG.debug('No available mdevs where found. '
8029+
'Creating an new one...')
80188030
chosen_mdev = self._create_new_mediated_device(parent_device)
80198031
if not chosen_mdev:
80208032
# If we can't find devices having available VGPUs, just raise
80218033
raise exception.ComputeResourcesUnavailable(
80228034
reason='mdev-capable resource is not available')
80238035
else:
80248036
chosen_mdevs.append(chosen_mdev)
8037+
LOG.info('Allocated mdev: %s.', chosen_mdev)
80258038
return chosen_mdevs
80268039

80278040
def _detach_mediated_devices(self, guest):

0 commit comments

Comments
 (0)