At start up of nova-compute service, the PCI stat pools are
populated based on information in pci_devices table in Nova
database. The pools are updated only when new device is added
or removed but not on any device changes like device type.
If an existing device is configured as SRIOV and nova-compute
is restarted, the pci_devices table gets updated but the device
is still listed under the old pool in pci_tracker.stats.pool
(in-memory object).
This patch looks for device type updates in existing devices
and updates the pools accordingly.
The functional test requires to skip the capabilities of pci
device. This can be done by getting capability template out of
pci_dev_template [1] which is introduced by commit
b927748c257e705903c2aa0ffa47b19914e31ede. Not able to clean
backport the mentioned commit and so removed funtional test
case.
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /761824 /opendev. org/openstack/ nova/commit/ 1fb4cc03e315f5b 4dbebc521f0d129 9273c7c396
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/rocky
commit 1fb4cc03e315f5b 4dbebc521f0d129 9273c7c396
Author: Hemanth Nakkina <email address hidden>
Date: Tue Sep 1 09:36:51 2020 +0530
Update pci stat pools based on PCI device changes
At start up of nova-compute service, the PCI stat pools are
populated based on information in pci_devices table in Nova
database. The pools are updated only when new device is added
or removed but not on any device changes like device type.
If an existing device is configured as SRIOV and nova-compute stats.pool
is restarted, the pci_devices table gets updated but the device
is still listed under the old pool in pci_tracker.
(in-memory object).
This patch looks for device type updates in existing devices
and updates the pools accordingly.
Conflicts:
nova/tests/ functional/ libvirt/ test_pci_ sriov_servers. py
nova/tests/ unit/virt/ libvirt/ fakelibvirt. py
The functional test requires to skip the capabilities of pci dev_template [1] which is introduced by commit e705903c2aa0ffa 47b19914e31ede. Not able to clean
device. This can be done by getting capability template out of
pci_
b927748c257
backport the mentioned commit and so removed funtional test
case.
[1] https:/ /opendev. org/openstack/ nova/src/ commit/ b0a451d4289dae2 086b730fde6b0c7 b30f3da2e8/ nova/tests/ unit/virt/ libvirt/ fakelibvirt. py#L186
Change-Id: Id4ebb06e634a61 2c8be4be6c678d8 265e0b99730 2b83b9d9d4c3301 48766644be) 8f6e7d6bde68b5e a6bb53dd8b) 39d11f82a61e0b4 7900f2eafa) ec2a5a20f7bf594 6b3075120d) fdf9305f3d15b20 1d780c8743)
Closes-Bug: #1892361
(cherry picked from commit b8695de6da56db4
(cherry picked from commit d8b8a8193b6b822
(cherry picked from commit f58399cf496566e
(cherry picked from commit 8378785f995dd4b
(cherry picked from commit 73e631862a81e85