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
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
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
Revert "Simplify how ephemeral disks are created and named."

This reverts commit e28d7870fa8633fddd5fe92d2fbcc34ae392bd85.

This needs another attempt. Associated with bug 1087028.

Change-Id: I5822b8934d4a944299ef32960bc56718193c32c3
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
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
Move api_paste_config option into nova.wsgi

The api_paste_config option is only used in nova.wsgi so we can
have it be registered there too.

blueprint: scope-config-opts
Change-Id: I438102b2524bd96faf8392f3ba600235ce7116a4
Move api_rate_limit and auth_strategy to nova.api

api_rate_limit is only used in nova.api.auth and auth_strategy is only used in
one other place. Scoping both options to nova.api.auth makes their purpose more
clear.

blueprint: scope-config-opts
Change-Id: I03f35c0e38239ecd96e8c304527530d42ab4097e
Move cache_images to nova.virt.xenapi.vm_utils

While the cache_images option sounds hypervisor agnostic, it is actually
xenapi specific. Move it into the xenapi driver makes this much more
clear.

blueprint: scope-config-opts
Change-Id: I5c86159f638fc30ee0158a249c91cf29d46cdbb5
Move some options into nova.image.glance

The glance_api_servers and glance_api_insecure options are only used in
nova.image.glance. The only other place that glance_num_retries is used
is nova.virt.xenapi.vm_utils.

blueprint: scope-config-opts
Change-Id: I2cd0f62e43379bc94c95f85ab5b4aac9faf6c4f7
Move zombie_instance_updated_at_window option

The zombie_instance_updated_at_window option is only used in
vm_vdi_cleaner so declare it there.

blueprint: scope-config-opts
Change-Id: I8d95fbd858f8afe855c2b559dea6995497d8f682
Move monkey patch config opts into nova.utils

The monkey_patch and monkey_patch_modules configuration options are
only used in nova.utils, so move them there.

blueprint: scope-config-opts
Change-Id: Ibfc34be46306041951ab0142ab737686eacae9da
Add get_backdoor_port to nova-conductor.

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

Change-Id: Ifb08c685a6f52621e954ba84e3c5eadf83fe4704
Don't leak info from libvirt LVM backed instances

* nova/virt/libvirt/utils.py (remove_logical_volumes):
Overwrite each logical volume with zero
(clear_logical_volume): LV obfuscation implementation.
(logical_volume_size): A utility function used by
clear_logical_volume()

Fixes bug: 1070539
Change-Id: I4e1024de8dfe9b0be3b0d6437c836d2042862f85
Merge "Don't leak info from libvirt LVM backed instances"