commit 66e79e1bbca66a6f0f7be14006a87426c4dda402
Author: Jay Pipes <email address hidden>
Date: Fri Mar 11 13:16:40 2016 -0500
pci - Claim devices outside of Claim constructor
During the nova.compute.Claim.__init__() call, there are a bunch of
_test_XXX() methods that are called. These methods should test to see
whether the requested resources of various types can be satisfied by the
inventory on the ComputeNode. However, that inventory *should not* be
claimed for a particular request during the Claim object's constructor.
The Claim._test_pci() method was *actually* claiming the PCI device for
the requested instance. Unfortunately, this meant that if an instance
launch request's demand for a resource like RAM was not able to be
satisfied by the compute node but the launch request's demand for PCI
devices *was* able to be satisfied by the compute node, those PCI
devices were actually claimed for the instance even though the claim
itself would end up being aborted. This resulted in a data
corruption/inconsistency where a PCI device would be claimed for an
instance that actually was not running on the node.
This patch moves the claim of PCI devices out of the _test_pci() method
and into the ResourceTracker.instance_claim() method. In the process of
fixing this bug, it was discovered that the unit tests for the Claim
object with regards to PCI devices were just plain broken. They were
testing for nothing at all because of the way the Claim constructor
works. These unit tests were reworked completely, along with the
MoveClaim unit tests which similarly were not testing the PCI code paths
at all. An additional unit test was added on the resource tracker to
verify that nova.pci.manager.PciDevTracker.claim_instance() is called
when PCI requests are included and satisfied by the Claim.
Reviewed: https:/ /review. openstack. org/291847 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=66e79e1bbca 66a6f0f7be14006 a87426c4dda402
Committed: https:/
Submitter: Jenkins
Branch: master
commit 66e79e1bbca66a6 f0f7be14006a874 26c4dda402
Author: Jay Pipes <email address hidden>
Date: Fri Mar 11 13:16:40 2016 -0500
pci - Claim devices outside of Claim constructor
During the nova.compute. Claim._ _init__ () call, there are a bunch of
_test_XXX() methods that are called. These methods should test to see
whether the requested resources of various types can be satisfied by the
inventory on the ComputeNode. However, that inventory *should not* be
claimed for a particular request during the Claim object's constructor.
The Claim._test_pci() method was *actually* claiming the PCI device for inconsistency where a PCI device would be claimed for an
the requested instance. Unfortunately, this meant that if an instance
launch request's demand for a resource like RAM was not able to be
satisfied by the compute node but the launch request's demand for PCI
devices *was* able to be satisfied by the compute node, those PCI
devices were actually claimed for the instance even though the claim
itself would end up being aborted. This resulted in a data
corruption/
instance that actually was not running on the node.
This patch moves the claim of PCI devices out of the _test_pci() method .instance_ claim() method. In the process of manager. PciDevTracker. claim_instance( ) is called
and into the ResourceTracker
fixing this bug, it was discovered that the unit tests for the Claim
object with regards to PCI devices were just plain broken. They were
testing for nothing at all because of the way the Claim constructor
works. These unit tests were reworked completely, along with the
MoveClaim unit tests which similarly were not testing the PCI code paths
at all. An additional unit test was added on the resource tracker to
verify that nova.pci.
when PCI requests are included and satisfied by the Claim.
Change-Id: Icf75439a552de8 4ec31c1a47faeee 3caf8a5b0a7
Closes-bug: #1549984