Move logging out of BDM attach method

We will want to call attach in code paths other than booting an instance
(attaching a volume to a running instance for example). This patch
moves the boot specific log message out of the attach method.

Change-Id: Id70d3cabdd118ee1879d7b593765a5034a7ec88e
Set SCSI as the default cdrom bus for PowerKVM

Set the default cdrom bus to scsi when the guest architecture is
ppc64 and the hypervisor is kvm|qemu. Checks the arch from
image_meta. Fallback to host arch if arch is not present in the
metadata associated with the image.

KVM unit tests without image_meta unified in a loop.

Change-Id: I62d1490ee8c9ba45a087f934342f14386ddb7cb2
Add ESX quality warning

In line with the other drivers we've been marking as untested,
this patch marks the ESX driver as "not tested" in the logs to
alert admins to the fact. The VCenter driver is being tested
with minesweeper, and thus does not emit a similar message on
startup.

Change-Id: I9217bab01761f68b716cdce3b21c2653abd9afa1
Add instance_get_active_by_window_joined to InstanceList

This is needed to remove get_active_by_window from nova compute API and
allow us to make the simple_tenant_usage API use Flavor objects.

Related to blueprint compute-manager-objects

Change-Id: I93354db2775f08346f9b812f1f1e78a4050efd4a
Use new images when spawning BM instances.

With nova-BM the TFTP files (kernel and ramdisk) are cached between
instances but disks never are (today). We were treating the disk image
the same way but this is incorrect because its filename is 'disk'
rather than '$uuid' and as such it has to be cleaned out whenever a
deploy request is being processed.

Change-Id: I15c8fc25a4c064341b9f1ed51e6df8d1494fbdff
Co-Authored-By: Robert Collins <rbtcollins@hp.com>
Rename API schema modules with removing "_schema"

The paths of API schema modules include "/schemas" and they show
API schema clearly. It is not necessary to include "_schema" in
module names. This patch renames the modules with removing "_schema"
from module names.

@validaiton.schema() takes 1 parameter, so calling it by name
is excessive. Then, this patch removes the specified argument.

By applying these changes, we can specify API schema module in one
line with @validation.schema().

Partially implements blueprint nova-api-validation-fw

Change-Id: Ia646e1c2466fa0a1418f757a48d2e6b4f84f7c98
Avoid deadlock when stringifying NetworkInfo model

In the libvirt driver, we log information about the instance we're
about to generate XML for, which includes a NetworkInfo model. In
reality, this is a NetworkInfoAsyncWrapper which acquires a lock
on the model. Since we're in the middle of a log statement, we also
hold the logging lock. This happens right after we've fired off an
async request to update information about the instance, which first
acquired the network model lock and then acquired the logging lock
to make a seemingly innocuous log record.

The resulting deadlock is fixed by this patch by stringifying the
NetworkInfo object before making the log call in the libvirt
driver.

Change-Id: I81f35197ab7c74daa84fb51fbaa2df28c025da13
Closes-bug: 1276268
Merge "Rename API schema modules with removing "_schema""
Merge "Move logging out of BDM attach method"
Fix VirtualInterfaceMacAddressException message

Previous the message reflected the default value of
create_unique_mac_address_attempts configuration option.

Changed to a generic message.

Change-Id: I55c5f95cfc7ac4183e08a7880cbbb9670a02cef4
Closes-Bug: #1276312
Merge "Add ESX quality warning"
Merge "Avoid deadlock when stringifying NetworkInfo model"
Merge "Use new images when spawning BM instances."
Merge "Set SCSI as the default cdrom bus for PowerKVM"
Merge "Add instance_get_active_by_window_joined to InstanceList"
Stacktrace on error from libvirt during unfilter

We are seeing this issue freqently in the gate, but we don't have any
stacktrace for what is happening.  An error from libvirt is an
unexpected exception and should include a stacktrace.

Related-Bug: #1275256
Change-Id: If7c0e19aba7a3d129f4b82f52d86b8e3b6a0a194
Merge "Stacktrace on error from libvirt during unfilter"
Merge "Fix VirtualInterfaceMacAddressException message"
Merge commit 'refs/changes/61/58861/12' of git://gold.eng.hq.xensource.com/git/github/openstack/nova into tmpbranch
Merge commit 'refs/changes/53/60253/8' of git://gold.eng.hq.xensource.com/git/github/openstack/nova into tmpbranch

Conflicts:
	nova/virt/xenapi/vm_utils.py