libvirt: Fix _cleanup_resize

Undefine domain and unplug vifs in _cleanup_resize if the instance was
migrated to another host.

Fixes bug 1015731

Change-Id: If6eb1ada029d462777bbd6ea113c98c3b801cf5d
Add nova-cert service to integrated_helpers

This allows us to do integration tests that need to use nova-cert.
Note that creating a certs for every test seems a bit excessive,
so this adds a fake_crypto module to return fake values.

Change-Id: Ia92c1dde8b122aef096004e9aad0a14ee587bbf0
Add api samples to Certificates extension

Change-Id: Ifb61c9cd90f03225c27b5683e5f54f30c636994c
powervm: exception handling improvements

PowerVMLPARInstanceNotFound should extend InstanceNotFound so nova
can handle it as an InstanceNotFound when LPARs are missing
Small bug fix so cleanup failing due to LPARs not existing does
not cause the delete to fail out, since we had nothing to cleanup

fixes bug #1061173

Change-Id: I3b26a477e55b4627f401dbb25c66d5e84ab1fa3f
powervm: remove broken instance filtering

Filtering isn't necessary (nor desired in some cases)
Irrelevant comment cleanup

fixes bug #1061291

Change-Id: I0798ff20aea7551b1d1100e8a439c39be99291e1
xenapi: Refactor snapshots during resize

Currently, we use VM.snapshot for resize, which fails if we have a
volume attached to the VM, which does not support snapshots. This change
uses VDI.snapshot instead, for all VDIs that are not attached by nova.

Also needed for xenapi: detaching and reattaching volumes during
migrations and reverting of migrations.

Fixes Bug #1028092

Change-Id: I3e2973747135a9c33de194e38537620c397bb87e
libvirt: ignore deleted domain while get block dev

The get_all_block_devices could raise libvirtError if domain was deleted
while listing instances. This will cause LibvirtISCSIVolumeDriver to fail
disconnect_volume. This patch ignores the domain that could not be found
to avoid this issue.

Fixes bug 1060836

Change-Id: I9dc994d8ca7fc084830adb4f6f9d3ca10e0fe577
Merge "libvirt: ignore deleted domain while get block dev"
Fix XML response for return_reservation_id.

The XML serializer for create uses the server template for it's response.
However, when return_reservation_id is set, only a reservation_id is
going to be returned.

To enable the XML response to be serialized the reservation id is now
returned in a server tag/object.

This commit fixes bug 1061124

Change-Id: Ic74071b1d527c3f3752e296d3fd46a28a99beb76
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
Merge "powervm: exception handling improvements"
Move snapshot image property inheritance

The xenapi snapshotting code had support for inheriting properties
from the base image of the snapshot (by way of the system metadata
set on the snapshotted instance).  The problem, however, came in the
fact that some image properties were set in nova.compute.api, but
those properties were not excluded from this inheritance logic
except through a configuration option called
"non_inheritable_image_properties".  I had previously updated the
default setting for this option to work around the bugs introduced
by setting image properties in two different locations, but now it
is time for the real fix.

This change moves the inheritance logic into
nova.compute.api:API._create_image.  Note that two properties are
still set through the xenapi snapshotting logic: the "os_type" and
the "auto_disk_config" properties, which are presumed to be xenapi
specific.  The change also alters the inheritance logic to ensure
that the work-around listing of image properties in
non_inheritable_image_properties is no longer necessary; the
default for this configuration option is updated accordingly.

(Note: It will not harm anything to have these image properties
still listed in non_inheritable_image_properties, so configurations
that override this option do not need to be altered.)

Change-Id: I3514da432cc10c75418e1de9752f60640d579136
Merge "powervm: remove broken instance filtering"
Merge "Add nova-cert service to integrated_helpers"
Merge "Add api samples to Certificates extension"
Merge "libvirt: Fix _cleanup_resize"
Merge "Fix XML response for return_reservation_id."
Merge "Move snapshot image property inheritance"
Always use bdm in instance_block_mapping on Xen

It doesn't seem that Xen will set the 'root_device_name' property on
instances.  This is causing instance_block_mapping to return early
without evaluating the bdm before returning the list of device_names
in use.  I'm not sure why instance_block_mapping does this
(optimization?) but on Xen at least it seems that it should not.

Added a check for Xen compute_driver flag in instance_block_mapping to
"guess" the root_device_name (similarlly to what is done in
compute.utils for swap and ephemeral).

fixes bug #1061944

Change-Id: If5b1a2b7377232c78f0629a3624552ecf6ceb0ee
Merge "xenapi: Refactor snapshots during resize"
Merge "Always use bdm in instance_block_mapping on Xen"