Reviewed: https://review.opendev.org/c/openstack/nova/+/951007 Committed: https://opendev.org/openstack/nova/commit/0bfac5c7fedece9fe28e0eebf9c7fb535a5ee431 Submitter: "Zuul (22348)" Branch: master
commit 0bfac5c7fedece9fe28e0eebf9c7fb535a5ee431 Author: Balazs Gibizer <[email protected]> Date: Tue May 27 16:48:22 2025 +0200 Return HTTP400 for multi spec pci alias if PCI in Placement PCI in Placement never supported PCI aliases with multiple specs, i.e. when an alias name is used in multiple alias definitions. The code raised ValueError late and without a proper error message. Now PciInvalidAlias with a descriptive message is raised instead. Closes-Bug: #2102038 Change-Id: Id1407a37dc5ddad22d8dbf7d589ed998ffc2804e ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/2102038 Title: Multiple spec for a single PCI alias config causes HTTP 500 if PCI In Placement is enabled Status in OpenStack Compute (nova): Fix Released Bug description: Reproduction: * define the [pci]alias config in a way that a single alias name is repeated and therefore associated with multiple spec dicts. E.g.: [pci] alias = { "name": "vf1", "product_id":"10ca", "vendor_id":"8086", "device_type":"type-VF"} alias = { "name": "vf1", "product_id":"f000", "vendor_id":"8086", "device_type":"type-VF"} This would mean the alias vf1 can be fulfilled from devices with product id 10ca OR f000. * create a flavor using the vf1 alias by using the pci_passthrough:alias: vf1:1 flavor extra spec * try to boot a VM with the flavor Expected: * either the VM boots successfully or the request is rejected that such PCI alias configuration is not supported Actual: * nova returns HTTP 500 Logs: Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi [None req-abaf1336-36f9-4877-9b56-6c30f21ac6ca admin admin] Unexpected exception in API method: ValueError: PCI tracking in placement does not support multiple specs per PCI request Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi Traceback (most recent call last): Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 731, in wrapped Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi return f(*args, **kwargs) Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi ^^^^^^^^^^^^^^^^^^ Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 135, in wrapper Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs) Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi ^^^^^^^^^^^^^^^^^^^^^ Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 135, in wrapper Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs) Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi ^^^^^^^^^^^^^^^^^^^^^ Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 135, in wrapper Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs) Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi ^^^^^^^^^^^^^^^^^^^^^ Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi [Previous line repeated 11 more times] Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/openstack/compute/servers.py", line 786, in create Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi instances, resv_id = self.compute_api.create( Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi ^^^^^^^^^^^^^^^^^^^^^^^^ Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/compute/api.py", line 2237, in create Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi return self._create_instance( Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi ^^^^^^^^^^^^^^^^^^^^^^ Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/compute/api.py", line 1764, in _create_instance Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi instances_to_build = self._provision_instances( Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi ^^^^^^^^^^^^^^^^^^^^^^^^^^ Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/compute/api.py", line 1580, in _provision_instances Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi with excutils.save_and_reraise_exception(): Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/data/venv/lib/python3.12/site-packages/oslo_utils/excutils.py", line 227, in __exit__ Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi self.force_reraise() Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/data/venv/lib/python3.12/site-packages/oslo_utils/excutils.py", line 200, in force_reraise Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi raise self.value Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/compute/api.py", line 1447, in _provision_instances Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi req_spec = objects.RequestSpec.from_components( Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/objects/request_spec.py", line 655, in from_components Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi spec_obj.generate_request_groups_from_pci_requests() Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/objects/request_spec.py", line 525, in generate_request_groups_from_pci_requests Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi raise ValueError( Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi ValueError: PCI tracking in placement does not support multiple specs per PCI request Mar 11 17:24:09 aio [email protected][235073]: ERROR nova.api.openstack.wsgi Mar 11 17:24:09 aio [email protected][235073]: INFO nova.api.openstack.wsgi [None req-abaf1336-36f9-4877-9b56-6c30f21ac6ca admin admin] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible. Mar 11 17:24:09 aio [email protected][235073]: <class 'ValueError'> Mar 11 17:24:09 aio [email protected][235073]: DEBUG nova.api.openstack.wsgi [None req-abaf1336-36f9-4877-9b56-6c30f21ac6ca admin admin] Returning 500 to user: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible. Mar 11 17:24:09 aio [email protected][235073]: <class 'ValueError'> {{(pid=235073) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1014}} Mar 11 17:24:09 aio [email protected][235073]: INFO nova.api.openstack.requestlog [None req-abaf1336-36f9-4877-9b56-6c30f21ac6ca admin admin] 192.168.121.77 "POST /compute/v2.1/servers" status: 500 len: 184 microversion: 2.96 time: 0.054444 To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/2102038/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

