The normal deploy flow uses a NetworkInfoAsyncWrapper for network
allocation, and because of that many places have to call that class's
wait method to make sure it has completed. During a reschedule where
the network was allocated by a previous build attempt, a NetworkInfo
instance is retrieved instead, which does not have a wait method. This
then results in an exception complaining the missing method when it is
called. This fix addresses that by adding a no-op wait method to the
NetworkInfo class. Alternatively could have used isinstance or hasattr
to avoid making wait calls on NetworkInfo, but that could be
problematic to maintain as more places need to make wait calls in the
future and may not know to make the isinstance/hasattr check.
This fixes a regression issue caused by
61fc1b9ee1 ,
which reverted the previous fix made under
24a04c405a
Change-Id: Id7a71b2eb46ea7df19e7da0afbc0eafa87cac965
Closes-Bug: 1636109
The driver_dict_from_config helper method is only used by the
libvirt driver and is very specific to how the libvirt driver
parses the libvirt_volume_drivers list of values, so this change
moves it to the libvirt driver so that we can expand it in a
following change to add specific error handling for the libvirt
driver.
Change-Id: I2b41d9e4e72b120f70371fff1201600acaa53708
Due to https://review.openstack.org/#/c/357537/ being
deprecated and removed certain tests in nova are now failing.
To make them pass again use the non-deprecated headers
instead.
Change-Id: I4e26c4517235f4320437904801c374d710655670
The "get_console_output" interface had code for python2.6 compatibility.
As we need at least python2.7, we can drop that code, which makes the
method (a little) easier to read.
The unit tests don't need any change, as the expected result is the same.
Change-Id: Ic3c22b96937a836dbc50b7ce3b2ba1a864450180
This commit adds in the default migration flags
VIR_MIGRATE_PERSIST_DEST which ensures that the domain XML migrated is
going to be set in libvird on destination node.
Change-Id: I7878e3cd227ed2cf6eb7c001e57c5fc830c0ec18
In notification_sample_base, a possible error is found and fixed, as
extra_params['return_reservation_id'] = True
is a valid code only when extra_params is not None.
However, this is not checked. So when we try to boot a server
without extra parameters, a TypeError is raised:
TypeError: 'NoneType' object does not support item assignment
In this patchset, the possible bug is fixed.
Change-Id: I80e2286b231da39b8c1e4225145422ac48daee68
With the update to oslotest 2.11.0, we're missing testscenarios
now in the unit test environment[1], so depend on it.
1: https://review.openstack.org/#/c/385274/
Change-Id: I57da89ade9eb3fcf920ec6d333db7577ee3ef138
The neutronv2 API is calling the method get_pci_device_devspec()
everytime a neutron port is created in order to get a PciDeviceSpec for a given
PCI device. This method creates a new Whitelist (based on the config
CONF.pci_passthrough_whitelist) and parses it every time it is called. This
is not a huge overhead but this is obvioulsy not needed and a waste of cycles.
Since only neutronv2 API uses get_pci_device_devspec(), this commit removes
the method in favor of using the Whitelist object directly (like it is done
in the PciDevTracker).
Change-Id: Idee4e9edecff0672680f323a916201aee8eeeabd
Closes-Bug: #1598843
In preparation for the placement REST API getting CRUD operations on
resource classes, create ResourceClass and ResourceClassList objects.
In this patch, we only add a ResourceClassList.get_all() method that
merges the standardized resource classes with any custom resource
classes that might have been added to the resource_classes table.
Followup patches will add the create(), delete() and save() methods and
then finally the REST API changes.
Change-Id: Ia9462698fafe3c70a51bb3746a6c2a45175fadf3
blueprint: custom-resource-classes
The ResourceProvider.set_inventory() method was not raising NotFound
when an Inventory object in the supplied InventoryList object was using
a resource class that did not exist in the resource class cache. This
patch fixes that by having the string_from_id() and id_from_string()
methods of the resource class cache raise ResourceClassNotFound instead
of returning None. We raise specific ResourceClassNotFound and
InventoryWithResourceClassNotFound exception subclasses to differentiate
in the inventory API handler between an unknown resource class and a
known resource class that doesn't exist in a given resource provider's
inventory.
We return a 400 Not Found when InventoryWithResourceClassNotFound is
raised on updating a single inventory, but return a 409 Conflict when
InventoryWithResourceClassNotFound is raised on updating a set of
inventory records since in the latter scenario, it represents a race
condition that frankly should not occur.
Change-Id: I350b02dcdbaa9d30d885cd085f60daa6b53a7745
This patch changes the context manager call in the _refresh_from_db()
method from this:
with ctx.session.connection() as conn:
to this:
with db_api.api_context_manager.reader.connection.using(ctx):
This is necessary to prevent errors about using a closed connection that
surfaced when writing a functional test case that tested that deleting a
custom resource class when inventory is associated with that custom
resource class.
Change-Id: I844d00028281ccbbfa527cd77469592fe1d7c151
In drop_move_claim we call free pci device when we need to drop a
specific device from the src/dest node. This is done by calling
pci manager free_device. The current code just update the device
status to available in database but doesn't remove it from the
pci manager claims and allocations lists. This patch adds the
removal as well.
Closes-Bug: #1622854
Change-Id: If1cd6f3a635759cd55d116a34ca164630c61e085
Specifying a PF passthrough device in the pci_passthrough_whitelist using its
fully qualified PCI address (no wildcard) causes the device to not be
properly loaded. The PCI device is then not available to be assigned to any
guest.
In this case, the hypervisor reports the PF device without a 'parent_addr'.
But in the PciAddress, match() is using it when doing the comparison to its
own address.
This commit changes the logic of the address matching method in PciDevSpec to
only try to match the address with a physical function device when a
'parent_addr' is reported by the hypervisor.
Change-Id: I5255240871d8ad5c216500f39520339efe46e84b
Closes-Bug: #1613434
User may set wrong values for live migration related config options,
log warning when setting with wrong values, will use parameter min
of IntOpt to enforce these config options' values in Pike.
Change-Id: I064958998939da3e05bd04631a36d2a507bf50c1
Realtime guarantees in certain operating systems require that the
thread that is running the QEMU emulator is pinned to a physical CPU
that is *not* the same as any physical CPU that the vCPUs for a
realtime guest are pinned to. This patch ensures that the value of the
hw:cpu_realtime_mask flavor extraspec property is respected when
creating the libvirt configuration XML and sets emulatorpin values to
a physical CPU matching the hw:cpu_realtime_mask value.
Change-Id: I7f50dde0753b059a690dc50172fee645c94b8e5b
Closes-Bug: #1614054