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
fix instance rescue without cmdline params in xml.rescue.

fix bug #1086780

Change-Id: I3495693b35dbde9c9da3d78208854b8ebc3f2a04
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
Remove fake_tests opt from test.py.

This is no longer used.

Change-Id: Ife0f528da6a9de5ae0567a049f5dbfce9c4a9615
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
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
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>
Move baremetal database tests to fixtures.

The baremetal database tests didn't get migrated to fixtures when we migrated
base nova. Funny story: maybe we should re-use code rather than copying!

So I did that. It's reusable now.

Change-Id: I730aad4a6aedb3993e032a14c9b8d2cd58913b4f
New Baremetal provisioning framework.

This is a minimal patch for the new baremetal driver.

With this driver, nova compute registers multiple entries of baremetal
nodes. It periodically updates the capabilities of the multiple
baremetal nodes and reports it as a list of capabilities.

It does not include Tilera or PXE back-ends, which will be provided
by subsequent patches. It also does not include VIF or volume components.

Part 4 of 7: blueprint general-bare-metal-provisioning-framework.

Change-Id: I55617a8da52d20d4df727b8bbde8e5f72d3bf130
Co-authored-by: Mikyung Kang <mkkang@isi.edu>
Co-authored-by: David Kang <dkang@isi.edu>
Co-authored-by: Ken Igarashi <igarashik@nttdocomo.co.jp>
Co-authored-by: Arata Notsu <notsu@virtualtech.jp>
Co-authored-by: Chris Krelle <NobodyCam@gmail.com>
Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>
Fix a test isolation error in compute.test_compute.

In the compute.test_compute tests the common notifier_api
test_notifier was being used. However, to use it correctly
requires that any existing drivers be reset, otherwise the
newly configured notifier does not take effect.

I converted the other call sites that were doing this to
also use cleanups rather than teardowns to reset it after
usage, which got rid of two boilerplate tearDown methods.

Change-Id: I6573d4652bb96dcebf38ef17d429d47d8a0e6434
Fix revert resize failure with disk.local not found

If we resize an instance from a flavor without ephemeral disk to a flavor
with it, it resizes OK, but if we revert this resize, the instance fail to
spawn with error disk.local not found.
The reason is that the libvirt driver get the wrong resized flavor from
instance, so the flavor info of instance should be updated before instance
spawns.

Fixes: bug #1086688

Change-Id: I2c54586803c60baab7f20297b309a8e6c4134d13
Baremetal VIF and Volume sub-drivers.

This patch implements VIF and Volume subdrivers for baremetal driver.
It was separated from review 11354.

blueprint general-bare-metal-provisioning-framework.

Change-Id: Id187d04b6bd7b838159d46d61be72256414d0e72
Co-authored-by: Mikyung Kang <mkkang@isi.edu>
Co-authored-by: David Kang <dkang@isi.edu>
Co-authored-by: Ken Igarashi <igarashik@nttdocomo.co.jp>
Co-authored-by: Arata Notsu <notsu@virtualtech.jp>
add 'random_seed' entry to instance metadata

This adds a 'random_seed' entry to the openstack metadata for an instance, both
in config-drive and in metadata service.  It is a 512 byte blob of base64
encoded random data.

In the metadata service, every call will result in new data.

The intent of this field is to add some entropy to an instances entropy pool.

Change-Id: I7d8c1f9bf70a9c5a54f6349f3277588553471555
Merge "Remove fake_tests opt from test.py."
Parameterize database connection in test.py

Make more of the db connection options into parameters instead of CONF
values so that they behave better when testing multiple DB back-ends,
as with the baremetal driver.

Change-Id: Ib122b86ded4bce430773c36fdb5f85bb71100d3d
Merge "Fix a test isolation error in compute.test_compute."
Merge "Move baremetal database tests to fixtures."
Merge "New Baremetal provisioning framework."
Fix _find_ports() for when backdoor_port is None.

For the case when backdoor_port is None for a service, then the
backdoor_port configuration option was not set for that service.
Instead of failing for this case, just skip establishing a backdoor
connection to services without a backdoor_port, and move on to the
other services.

Change-Id: I0fad967f94b9d9928e9134fe5901d5e256b6ab69