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
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
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
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
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
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
fixing the typo of the error message from nbd

bug 1092640

Change-Id: I6743aea8cc96570a4a24e4a34d7b0b7f904c485d
Add API samples tests for the coverage extension.

Partially implements blueprint nova-api-samples
Fixes bug 1089531

Change-Id: I5b287ea210f275a0c316a28d6dc3614d107aff05
Provide a configdrive helper which uses contextlib.

As suggested on review of Ib23d117ad4cd5dc92298a0812eb468f7d557417c.

Resolves bug 1092248.

Change-Id: I2829ac60732b86b9853983b03ef6f30f5c5a3283
Refactor libvirt VIF classes to reduce duplicate code

Irrespective of the VIF driver used, some config parameters are
always identical (mac addr, NIC model). Move creation of the
vconfig.LibvirtConfigGuestInterface instance into a base class,
so VIF driver impls only need to provide their custom data.

Change-Id: I7c9d5357c8ceff6d5eb2c982a7420bc93a7266bf
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Make libvirt driver default to virtio for KVM/QEMU NICs

Currently users of KVM/QEMU must set libvirt_use_virtio_for_bridges
to true to get a virtio based NIC, instead of the awful rtl8139
that QEMU defaults to.

Switch libvirt_use_virtio_for_bridges to default to enabled, but
ensure it only takes effect if libvirt_type is 'kvm' or 'qemu'.

Although it is possible that some guest OS do not support virtio
drivers, currently Nova hardcodes use of 'virtio' for disks, so
this change doesn't make the current guest OS support situation
worse.

Obviously in the future, both NIC & disk models will have to be
made fully configurable

Change-Id: I7c0d306921f554ac2d06b5bdb1f9017ab7f9c643
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Removed unused imports.

Removed a bunch of unused imports based on pyflakes.

Change-Id: I00952371200cb4531ddf163447433da756582a21
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Log last compute error when rescheduling.

When a scheduling attempt is re-tried, log the last exception from
the compute side.  The goal is to provide simpler access to debugging
information about why a build/resize is having issues.

Change-Id: Ic31852dcbbf1cea9034a4b8eb1c7d20178c3229d
Merge "Refactor libvirt VIF classes to reduce duplicate code"
Merge "Fix "image_meta" data passed in libvirt test case"