Volume backed live migration w/o shared storage

This patch allows live migration of volume backed instances without
the need for shared storage (For Libvirt only).

Fixes LP Bug #1074054
DocImpact

Change-Id: If7abd63a610a44720cec2d4021cc4ee737ea301d
Refactor xvp console

Small re-factoring of the xvp console mainly checking
to make sure that we catch exceptions when they haappen.

Change-Id: I0164111ffa4439d82ae26084433901236a4a2ddc
Signed-off-by: Chuck Short <chuck.short@canonical.com>
libvirt: Skip intermediate base files with qcow2.

Instead of having two files in _base (the original and a resized
copy), let's just keep the originals and resize with the qcow2
image in the instance's directory. This will reduce the size of
_base and simplify cleanup. This also simplifies resizing of
instance disk images later.

Resolves bug 1087031.

Change-Id: Id91426e3cb9f75f31339b5156785e3782a4cb98f
Added sample tests to FlavorDisabled API.

Partially implements blueprint nova-api-samples
Fixes bug 1070161

Change-Id: I889a5b2e85d31fda1e9a8a82043ba7e9ddf1b7a6
fix instance rescue without cmdline params in xml.rescue.

fix bug #1086780

Change-Id: I3495693b35dbde9c9da3d78208854b8ebc3f2a04
Fix stack trace on incorrect nova-manage args.

This error reporting needs more work, but this at least stops us
from presenting a stack trace to the user and is as broken as
before.

Resolves bug 1091403.

Change-Id: I941983b60cc3762a916d57b7ea67264e093cfa44
Execute pygrub using nova-rootwrap in xenapi

Preserve the behavior where, if pygrub fails, compute attempts
to spawn the VM in HVM mode.

Fixes bug #1091628

Change-Id: Ia462964ebb1fc21d8e289de32557a2e7867f1257
allow for the ability to run partial coverage

the way the coverage exclusion was made previously meant that
if you ran coverage, it would always run all the tests. Fix
this so you can run a subset.

Change-Id: I057587204728d379e2a43b5c5ee14fe91f83f64b
Update exceptions to pass correct kwargs.

Updates a variety of Nova exceptions so that they pass the correct
kwargs for proper exception message formatting. Previously
these exceptions would work but have incorrect error messages
because of how NovaException handled exception formatting errors.

Change-Id: I9601d3884a72d53a8ad742cf6610399968747cea
Raise old exception instance instead of new one.

Updates the Nova conductor API's ExceptionHelper class so that
it raises the previous exception instance instead of constructing
a new exception class based on the old one's message.

The motivation for this change is to enable testing of NovaException
message formatting. Previously this function would always construct
a new NovaException which had the incorrect (none) kwargs specified
to properly format the message. The exception would get thrown... but
it would cause extra LOG.error messages to appear in the log file due
to the formatting errors.

This commit works around the issue by raising the previous Exception
directly. From 'pydoc raise':

  If the first object is an instance, the type of the exception is the
  class of the instance, the instance itself is the value, and the
  second object must be ``None``.

Change-Id: I1dddc9e1e7e3d5f970baa9a34b709c943820295e
Fix "image_meta" data passed in libvirt test case

The helper method _check_xml_and_uuid expects a disk
image metadata dictionary as its first parameter. The
caller was instead passing a instance dictionary. The
tests pass regardless, but passing the right data
avoids future developer confusion.

Change-Id: Ia594e8aa38a8627d304537c09d0d28a3e3a2b27b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reliably include OS type in ephemeral filenames.

Either include the OS type, or "default" if this isn't specified.

Also, I don't see why we care what ephemeral disk number this disk
was created as (they're all empty images in base, right?) so I've
removed that.

Resolves bug 1087030.

Change-Id: Iee7f8e9033a2e6a829421763090ed0e67c6b2da8
libvirt: Make vif_driver.plug() returns None

The return value of vif_driver.plug() was used only when nova wrote the
libvirt.xml file on initial boot of the instance. Make it returns None,
and add get_config() to get the configurations if needed.

If LibvirtBridgeDriver is used when the nova-comptue inits, we call
vif_driver.plug() without get the VIF configurations. By doing this
plug doesn't raise if the instance has not yet got a fixed-ip. Fixes
bug 1076309.

Change-Id: I0fafb3d98e3139bce0ef2cee04cab428a0621696
Fix race condition of resize confirmation

Currently, the db update of migration status is after the db update of
instance's vm_state in _finish_resize, so a race condition occurs when an
instance's vm_state is updated but the migration status doesn't, and at
this moment a resize confirmation is performed, then an exception
'MigrationNotFoundByStatus' is raised.

Fixes: bug #1066140

Change-Id: I1dac98cc99d3491c92faaad2b9dcc40d7c0524b5
Extract image metadata from Cinder

This patch makes nova extract image metadata if it is present in the
volume dict received from Cinder API.

The volume image metadata is received from Cinder when the
volume_image_metadata Cinder extension is loaded.

This patch is part of the work done on blueprint improve-boot-from-volume
as this metadata will be used when booting instances from volumes
without the need to supply an image just for the metadata. Subsequent
patches will make Nova consider this metadata when booting instances
without and image id.

Change-Id: I9e5925ea4147a41c41f9019933a47c5ccf756747
Trap exception when trying to write csr

Trap the exception when trying to write the csr fails.
Fixes LP: #1092016

Change-Id: I05675c8c7b1d205a06d13dd3e62e06088d1b896d
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Add get_backdoor_port to consoleauth.

This adds a get_backdoor_port function to the consoleauth
service which enables returning the eventlet_backdoor port
from rpc for the service.

Change-Id: I7da9cbc8111342b5f49f148a8e3389faf5c4f2ab
Add get_backdoor_port to console.

This adds a get_backdoor_port function to the console
service which enables returning the eventlet_backdoor port
from rpc for the service.

Change-Id: I3cb7d199fac8c10e4b5fdc04c403b63e75a69d2d
Add get_backdoor_port to scheduler.

This adds a get_backdoor_port function to the scheduler
service which enables returning the eventlet_backdoor port
from rpc for the service.

Change-Id: Ib88e2a9e709d5240722027c94e6762b4a3bd918c
Add get_backdoor_port to cert.

This adds a get_backdoor_port function to the cert service
which enables returning the eventlet_backdoor port from rpc
for the service.

Change-Id: Iea2b1f9587ea2749c2def921d6a0d1e86f1645ee