Fix for volume detach error when use NFS as the cinder backend

For NFS volumes, every time you detach a volume, nova tries to umount
the device path. If the device path is busy (or in use), it should
output a message to log and continue.
In current code, if the device is busy, it cannot catch the ‘device is busy’
message returned by umount, because it looking for the ‘target is busy’.
 Therefore, current code skip the ‘if’ statement and run the ‘else’ and
raise the exception.
Fix: Add ‘device is busy’ to if statement.

Add a mock test to check the behaviour of the
virt.libvirt.volume.LibvirtNFSVolumeDriver.disconnect_volume
when it has umount errors.

Closes-Bug: #1340552

Change-Id: Iac946c37064c5f5bf5a102305de40d21d16846c1
Fixes a Hyper-V list_instances localization issue

The Hyper-V WMI MSVM_ComputerSystem class Caption property can
have different values on various locales. This patch uses a
different query to avoid any localization issue.

Co-Authored-By: Robert Tingirica <rtingirica@cloudbasesolutions.com>
Change-Id: I15103b8edb3ff8934c835826ed00e08593cdeacc
Closes-Bug: #1296478
xenapi: send chunk terminator on subprocess exc

During chunk upload if a subprocess exception is thrown, a malformed
chunk upload occurs.

This patch adds logging for subprocess exceptions and sends the
terminator even in the event of a subprocess exception. The incomplete
file upload will then be cleaned up by the client.

Change-Id: I559f201430bcd4c36d669c7772a10bfe3cd54d41
Closes-Bug: 1365637
VMware: add tests for image fetch/cache functions

Adds unit tests for the vmops image fetch/prepare/cache functions.
No existing tests are modified.

partial blueprint vmware-spawn-refactor

Change-Id: I913c7f5ecfec586ff79e2bc7ab1969a8824476b5
Ironic: don't canonicalize extra_specs data

Don't canonicalize the cpu_arch extra_specs field. This is important
because the scheduler filters which use extra specs don't canonicalize
things either and as such you'll have mismatched fields causing
instances not to get scheduled.

This was recently changed as part of the Ironic -> Nova driver patch
series. We still want to canonicalize supported_instances though...

Change-Id: I9342213b5433113816142b1f737119065e9f077f
Closes-bug: #1366859
document why we disable usb_tablet in code

This provides a code level explanation for why we disregard the user
option for use_usb_tablet when the spice agent is enabled. It came up
in a bug report, and having the comment close to the code helps carry
the information forward.

Change-Id: I7945e921b6283519d91e234584d99d9e82218e6d
Closes-Bug: #1356633
Nova-net: fix server side deallocate_for_instance()

Client side of the network RPC API sets 'requested_networks'
parameter in deallocate_for_instance() call,
while server side expected 'fixed_ips' parameter.
This patch fixes server side so it handles 'requested_networks'

Closes-Bug: #1350355

Change-Id: If9554a2e98397c5e63e929e1606d99dd2328262c
compute: Add standard constants for hypervisor virt types

Introduce a nova/compute/hvtype.py module to serve a similar
role to nova/compute/vm_mode.py, by providing constants for known
hypervisor virtualization types. This is primarily used as second
component of entries in the 'supported_instances' host state
property. It is not to be confused with the hypervisor driver
types.

Related-bug: #1348623
Change-Id: I553697992b010179e2bbf25fb8c0d471a15e4b3e
Improve logging of external events on the compute node

We don't log every event we receive on the compute node, which could
allow some to slip through and look like they were never received. This
patch makes sure to debug log each one so we at least know that it made
it from API to compute.

Change-Id: I817248ea8167be21c55fecad3a39cb45b027596c
Related-bug: #1357476
Proxy nova baremetal commands to Ironic

This patch will proxy baremetal-node-list and baremetal-node-show
commands to Ironic. All other commands will raise an error if the
compute_driver is set to Ironic, otherwise the api will act as
expected.

Co-authored-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
Change-Id: Id9209d1d34a725750342434fbde1ff5681ff06b8
neutronv2: attempt to delete all ports

Previously when deleting ports during allocate
or deallocate, the operation would fail on the
first non-404 error encountered. We now loop
through all of the ports and attempt the delete.

In the allocate flow we don't raise any errors
since the instance is set to ERROR anyway and
we're just trying to cleanup.

In the deallocate flow we attempt to delete all
of the ports and if there was a non-404 exception
we raise that at the end so the overall instance
delete operation fails.

Change-Id: Ibf68e0b4770b09ee32f187b85f2ca96984117e0b
Closes-bug: #1292243
Co-Authored-By: Dan Smith <dansmith@redhat.com>
Co-Authored-By: Sean Dague <sean@dague.net>
Co-Authored-By: Matt Riedemann <mriedem@us.ibm.com>
Add quotas for Server Groups (V2 API change)

This second change in a sequence that adds new quota values
for server groups.  This part adds the new V2 API extensions
to make the new quota values visible and changeable, and updates
the unit tests to check both V2 cases.

Note that Tempest changes https://review.openstack.org/#/c/112474/
is required to get a clean run as it checks for a specific
set of values.

The quota checks themselves are covered in a subsequent
dependent change.

Implements: blueprint server-group-quotas
DocImpact

Change-Id: I78974602d4be04deaf173b3e43f2dab92e8f4171
Add quotas for Server Groups (quota checks)

This third change in a sequence that adds new quota values
for server groups, which implements the quota checks.

Co-authored-by: Cyril Roelandt <cyril.roelandt@enovance.com>

Implements: blueprint server-group-quotas
DocImpact

Change-Id: I535c4ac2475d0b0ca6e14081f92e1c7d111792bd
Merge "document why we disable usb_tablet in code"
Merge "VMware: add tests for image fetch/cache functions"
Merge "compute: Add standard constants for hypervisor virt types"
Merge "Improve logging of external events on the compute node"
Merge "Proxy nova baremetal commands to Ironic"
Merge "Fix for volume detach error when use NFS as the cinder backend"
Merge "xenapi: send chunk terminator on subprocess exc"