script for configuring a vif in Xen in non-bridged mode

Creates a new vif device without attaching it to a
bridge. Quantum Linux Bridge Agent will attach the
created device to the belonging bridge.

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

This is no longer used.

Change-Id: Ife0f528da6a9de5ae0567a049f5dbfce9c4a9615
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
Define a product, vendor & package strings in version.py

To have one single place where all code in Nova can access
product, vendor & package strings, extend version.py to
expose a product_string(), vendor_string() and package_string()
methods. The product will default to "OpenStack Nova", the
vendor to "OpenStack" and the package to None. The latter is
intended solely for OS distro vendors to include their package
version suffix (eg the "Release:" field from RPM or perhaps
a VCS tag)

Following changes will make this data configurable via a
plain text file, and then update various parts of Nova to
make use of the data.

Change-Id: I3eb14d11f8949ce909a8f529851913d3dccf0e8c
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
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>
Remove obsolete VCS version info completely

The VCS version string in nova/version.py has been hardcoded
to 'LOCALBRANCH:LOCALVERSION' since change

  0bbb0e8cb1daa351af91cf97b2bcababfc0c7f9f

The only places which use this info are some logging calls,
and since 'nova-manager version' command. The latter would
more usefully output the distro specific package string.

Delete the VCS related methods in version.py and replace their
usage with a new method version_string_with_package() which
appends the distro-specific package tag

Change-Id: I972b79c329198cb5376d537c6b672830094cd759
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>