Nova network needs to take care of existing alias

Nova network should take care of existing aliases on bridge
interfaces when it adds address on top of the list.

Change-Id: Ife54c9eba64906406f7c44a66b596f3162ad16b6
Fixes: bug #1077066
Rework instance actions to work with cells

In a cells setup an instance action is recorded at the global cell level
while events try to get recorded in a child cell compute node or
scheduler.  The event recording fails because it can't find an action to
link to.  This patch adds the recording of actions at the child cell
level, and changes the API extension to query the db in a child cell for
the record of actions and events.

This does not address the fact that an action is recorded at the global
cell level.

Bug 1132935
Change-Id: I5831f146397e7afa2d93d26c5d6f9abb9bc6670d
Fix ephemeral devices on LVM don't get mkfs'd

Fixes bug 1083424

Updated imagebackend to run the necessary callback conditionally
based on whether LVM is configured for use and ephemeral_size is
defined. The callback function was updated not to invoke qemu-img
for LVM, since the ephemeral disk is already present/created via
LVM. Lastly, the mkfs call had to be changed to be run as root,
since we are dealing with raw devices.

Change-Id: Ieb1febb0ea086f8e5063d92ca376d349fcd43a43
Read baremetal images from extra_specs namespace.

Baremetal PXE driver should read deploy_kernel_id & deploy_ramdisk_id
from the 'baremetal:' namespace within instance_type['extra_specs']
so that it doesn't conflict with ComputeCapabilitiesFilter any more.

Fixes bug 1129485.

Change-Id: I84b3acb2ed83dc2b1ff8f1a21ca1d95f7d25751a
Fix Network object encoding issue when using qpid

When creating network via REST API will throw the exception
"CodecException: no encoding for
<nova.db.sqlalchemy.models.Network object at 0x4a8ea10>".
It only occurs when using qpid.
Fix this issue through using jsonutils.to_primitive method.

Fix bug 1143584.

Change-Id: I833aef451f8e3d5eaa246c19d67b2474a9d36910
delete deleted image 500 bug

Fixes bug 1138666

When you delete an image that you just deleted, you get a 500 Internal Server Error.
In this case, the problem isn't an internal server error but the "unauthorized" response
from the image service is not expected.

This can be recreated with devstack:
 1) delete an image
 2) delete the same image

Here's an example:

$ nova image-list
+--------------------------------------+---------------------------------+--------+--------+
| ID                                   | Name                            | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| caa6c969-0f32-466b-8e8e-a7e0ac835470 | cirros-0.3.1-x86_64-uec         | ACTIVE |        |
| 8af603da-b69f-49c6-8e52-25632eccb31c | cirros-0.3.1-x86_64-uec-kernel  | ACTIVE |        |
| fe67d4e1-baca-4968-8638-2314373b620b | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE |        |
+--------------------------------------+---------------------------------+--------+--------+

$ nova image-delete caa6c969-0f32-466b-8e8e-a7e0ac835470

$ nova image-delete caa6c969-0f32-466b-8e8e-a7e0ac835470
ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-1254f8a5-8dda-444a-a077-2072ab3baa6a)

If you delete a deleted image, the server should respond with '403 Forbidden'
because the image still exists and no user is allowed to delete a deleted image.

The fix is to catch the exception from the image service and
convert it to a wsgi exception for '403 Forbidden'.

Change-Id: I2f14687d5468b67389f5dd6ab338ceb54e8a29bb
Add missing action_start if deleting resized inst.

When trying to delete a resized instance Nova will automatically
call confirm on the resized instance to help clean things
up. With some of the recent action event changes in grizzly this
code path was broken due to a missing record_action_start
call on the confirm_resize operation.

Fixes LP Bug #1147387.

Change-Id: I23e84de8675c980656a71b71e34ffa0a0801f389
Fixed image filter support for vmware

The vmware compute driver does not support the image filter
based on hypervisor_type. In a heterogeneous environment,
this filter attribute allows us to provision an instance
to a specific hypervisor based on the property of the
glance image. The solution is to populate the dictionary
'supported_instances' from the vmware compute driver.

Fix for bug 1131542

Change-Id: I6ebf9f0d4a17b3083f66f69f077f910552d9a951
Remove uses of instance['instance_type'] from xenapi driver.

Note that this includes a fix to tests/db/fakes.py to make the fake
instance_type structures look like the database models.

This is one change in a series aimed at removing the use of instance-linked
instance_type objects, in favor of the decoupled type data in
system_metadata. See bug 1140119 for more details.

Change-Id: Ieb107fbaf0f3b5a42681aefc0ffdefdb8c0f98a5
Remove uses of instance['instance_type'] from powervm driver.

This is one change in a series aimed at removing the use of instance-linked
instance_type objects, in favor of the decoupled type data in
system_metadata. See bug 1140119 for more details.

Change-Id: I885a807d00f7f909665da6e7a3382295a43258c9
Remove uses of instance['instance_type'] from libvirt driver.

Note that this includes a few tweaks to the libvirt tests where the instance
type in use was expected to have no swap, but the actual id-matching fake
did. This integration makes it a little harder for the tests to be out
of whack like that, which is good.

This is one change in a series aimed at removing the use of instance-linked
instance_type objects, in favor of the decoupled type data in
system_metadata. See bug 1140119 for more details.

Change-Id: I190258bd0947944d9bcdf49956eed40d402606f5
Remove duplicate API logging.

Before each API call logged the same data three times on INFO level. We only need to log the information once.

Fix bug 975589

Change-Id: I24131cf9f1c27030ecc99e638e9f4126096a0b96
Remove unnecessary setUp() and tearDown() methods

It's unnecessary to implement setUp() and tearDown() when they only call
the parent class method of the same name.

Change-Id: I8a2c7f50e17def87ada8d4f1c1b554eb916afbd1
Tiny typo

virtualizated -> virtualized

Change-Id: Ie5006f2fdd1d6963b35c63e749ffe939d5fb9bcc
Merge "Remove unnecessary setUp() and tearDown() methods"
Fix instance type cleanup when doing a same-id migration

Previously, we assumed that we were moving from one flavor to another during
a migration (i.e. a resize). That assumption failed when a regular migration
went to delete the old_ stashed instance types from system_metadata.

This unifies the cleanup logic, which only gets performed if we're actually
doing a resize.

Fixes bug 1136768

Change-Id: I0796864b044fc746583164e4a684f79dc431c137
Update tox.ini to support RHEL 6.x.

In order to support running unit tests on RHEL 6.x we need to patch
eventlet with contrib/redhat-eventlet.patch. We already
have support for this in the tools/install_venv_common.py but we need
to make a couple changes to allow tox to consume this:

1) Sync in the latest intall_venv_common.py from oslo. This changes
 patch to use the -N option (ignore already applied patches) and makes
 it safe to call the patching function more than once.

2) Add a new patch_tox_venv.py script in tools.

3) Update tox.ini to call patch_tox_venv.py before it runs tests and
coverage.

Change-Id: I3e2b07c3f718e4aede5c5f231ff0cdb7721ec885
Merge "Remove duplicate API logging."
Merge "Remove uses of instance['instance_type'] from xenapi driver."
Merge "Update tox.ini to support RHEL 6.x."