Comment 9 for bug 1581471

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/nova (9.0/mitaka)

Reviewed: https://review.fuel-infra.org/21473
Submitter: Pkgs Jenkins <email address hidden>
Branch: 9.0/mitaka

Commit: 36dbc9fe165e9f9936148a82f1c66e7cc44a9b19
Author: Jay Pipes <email address hidden>
Date: Wed Jun 1 09:52:56 2016

pci: eliminate DB lookup PCI requests during claim

The nova.pci.manager.PciDevTracker.claim_instance() accepted an Instance
object and called nova.objects.InstancePCIRequests.get_by_instance() to
retrieve the PCI requests for the instance. This caused a DB lookup of
the PCI requests for that instance, even though in all situations other
than for migration/resize, the instance's PCI requests were already
retrieved by the resource tracker.

This change removes that additional DB lookup during claim_instance() by
changing the instance parameter to instead be an InstancePCIRequests
object and an InstanceNUMATopology object.

Also in this patch is a change to nova.objects.PciDevice.claim() that
changes the single parameter to an instance UUID instead of an Instance
object, since nothing other than the instance's UUID was used in the
method.

Related-Bug: #1368201
Closes-Bug: #1581471

Change-Id: I9ab10c3035628f083233114b47b43a9b9ecdd166
(cherry picked from commit 1f259e2a9423a4777f79ca561d5e6a74747a5019)