use file instead of tap for non-blockdevice images on Xen

In nova/virt/libvirt/utils.py the method pick_disk_driver_name() returns
"tap" for non-blockdevices on Xen. This leads to an exception on the
xend service. The returned driver name should be "file" instead of
"tap".

fixes bug 1084618

Change-Id: Ib87f18f56afb3c5f34c30e9aea605dad24a36cdf
Fix handling of unimplemented host actions

Fixes bug #1060884

Host actions like enable/disable, maintenance mode and power management
are not implemented in most virt drivers.

In the case of set_host_enabled() in the libvirt driver, we have a no-op
implementation. In other cases we have an implementation which raises
NotImplementedError. Since the default implementation is to do this, we
should just remove the redundant methods from the drivers which don't
actually implement these actions. This ensures NotImplementedError is
consistently raised.

On the API side, rather than looking at the return value of these
methods to determine whether they're implemented, we should just catch
NotImplementedError and return a sensible error message.

In order to do this, we need to ensure the NotImplementedError is
properly deserialized from the RemoteError which will encapsualte
it. The fix for bug #1086798 ensures this happens.

Finally, add some tests to make sure we properly respond with 501
when the virt driver doesn't implement these actions.

Change-Id: I2d4fc51a4b16d5230e61bde75915142ea450557d
Catch ProcessExecutionError when building config drives.

There's not a lot we can do here, the instance is invalid. However,
the better log message will hopefully make this easier for operators
to diagnose.

Partially addresses bug 872489.

Change-Id: Ib650cb114e57956bfe911370dd52aa4fdd4adc78
Improve virt/disk/mount/nbd test coverage.

Change-Id: I7d1c413b7a492c078ae10c840c4c20f8cf69d6a5
Set default DNS driver to No-op.

In 522ac62 we set the default network DNS driver to MiniDNS
which was primarily meant for testing only.

This patch adds a NoopDNSDriver and updates the Nova default
to use it.

Fixes LP Bug #1088603.

Change-Id: Id3bdf86e0ea16fc6d4490436afbabc7a95cf820b
i18n raise Exception messages

Provide i18n to some exceptions that were not
provided before.

Change-Id: Ia320ba5f12e82686c8ee7973a77f152eb4b02bd4
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Map cinder snapshot statuses to ec2.

EC2 has way fewer statuses than cinder does, so we need to map them
to valid entries. Resolves bug 1080284.

DocImpact.

Change-Id: I73bb2905577fb6f727c0a805df2654ad1bb4ad72
Make DNS drivers inherit interface.

Updates the DNS driver implementations so they inherit
the interface. Should help catch things that aren't
implemented in the future.

Change-Id: Ic8b269c8525236c65b492c889d4530a09836bb13
Merge "Set default DNS driver to No-op."
Consider reserved count in os-user-limits extension

Fixes bug 1088606

Previously, the reserved count was not considered in the
total<Resource>Used values returned, leading to a potentially
inaccurate view of the actual headroom available when resource
creation was in-flight.

Now, the reserved count is optionally included, controlled
by a new 'reserved' query parameter.

Change-Id: If71ac6f8e428b58b7c80c67ad99124e4233102d1
Set instance_ref['node'] in _set_instance_host_and_node

instance_ref is finally passed to ComputeDriver.spawn().
The instance_ref['node'] must be set before spawn() is called
since a ComputeDriver managing multiple nodes may use the value
in spawn(). Without this patch, _set_instance_host_and_node()
updates only 'host' and 'launched_on' in instance_ref although
it updates 'host', 'launched_on' and 'node' in DB.
It is natural and necessary that we set instance_ref['node'] there.

blueprint general-bare-metal-provisioning-framework

Change-Id: I5cdf7d9a9d59d30a9e2f1d15c9ec74428828570c
Correctly init XenAPIDriver in vm_vdi_cleaner.py

Fixes bug 1088615

Change-Id: Iaf0569fd45ed180d141dc0367c547f014b7502e1
Fix bw_usage_update issue with conductor

During a rebase, the tests for the conductor's implementation of
bw_usage_*() were lost. This caused some later changes to go
untested, and thus, introduce errors. This patch:

1. Fixes the calling order of bw_usage_get() from LocalAPI
2. Fixes the test used to determine if an update should be performed
3. Fixes the RPC API version number that should have been bumped
4. Adds the tests

Yikes.

Change-Id: I87c8ad19002d7cc420dc15f6ae21c6bfcbb0ee53
Revert "Simplify how ephemeral disks are created and named."

This reverts commit e28d7870fa8633fddd5fe92d2fbcc34ae392bd85.

This needs another attempt. Associated with bug 1087028.

Change-Id: I5822b8934d4a944299ef32960bc56718193c32c3
Make nova/virt use aggregate['metadetails']

This patch makes nova/virt use the metadata attached to the
aggregate object instead of querying it separately. This allows
us to remove a method from VirtAPI and avoid adding another one to
conductor to support it.

Change-Id: I4b9ff59147d30ff6f71fa66e838f060b8853dc95
Merge "Fix bw_usage_update issue with conductor"
Merge "Correctly init XenAPIDriver in vm_vdi_cleaner.py"
Modified sample tests to FlavorExtraData API.

Added subs wherever applicable.
Added checks for correct return codes after REST ops
Modified sample tests to FlavorManage API to differentiate them
from the ones in FlavorExtraData.

Partially implements blueprint nova-api-samples
Fixes bug 1070162

Change-Id: I57c6611f379bef2ff586551b5501c4f7654e4374
Move all temporary files into a single /tmp subdir.

Also setup a temporary homedir to prevent interactions with
user configuration.

This fixes bug 1088761.

Change-Id: I31f1b839593351648cd7b4fb9371562c1348fafc
Cleanup the test DNS managers.

There is a fair amount of indirection in place here, which could be
trimmed - this patch takes a minimal approach and only causes the
current top level entry to be called, fixing bug 1088761.

Change-Id: Ifd80f99561eb95257f2a1bf45a39f678a2c1f59c