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
Push 'Error' result from event to instance action.

Currently a failed event stores an 'Error' result but in order to see
which actions have failed it would require grabbing each one through the
api to see the events.  This patch adds 'Error' to the message field of
the instance action so that any actions with failures can be seen from
the initial listing of actions on an instance.

Change-Id: Ieeb798c47211ab00fe5b767dc1f18a665549ba01
Standardize the coverage initializations.

Now when we measure coverage repeatedly, the coverage data of
nova-api is accumulated but the ones of other nova services are
reset each time.
This is due to create new "coverage" class each time
"_start_coverage_telnet" method is executed.

This patch limits creating "coverage" class the first time
the method is executed.

Fixes bug 1122720

Change-Id: Ia900c96113bee65362ccb7c4c1975535d814d835
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
Return proper error messages while disassociating floating IP

Currently, when a floating IP is not associated with an instance, and if we try
to disassociate it, a response likes "HTTP/1.1 404 Not Found" will be returned,
it is not proper, so change it to "HTTP/1.1 422 Unprocessable Entity" with body
likes '{"computeFault": {"message": "Floating ip 172.24.4.225 is not associated
with instance a33857af-b18b-4b88-a5cc-7d84c7fd41c8.", "code": 422}}'.

Fixes bug: #1129719

Change-Id: I18194ccf59edb5eb2bcd52a65f38d5632fef95d3
Ensure that FORWARD rule also supports DHCP

The previous fix only addressed the INPUT rules and not the
FORWARD rule.

Adds FORWARD rule to ensure that DHCP traffic is forwarded correctly.

Fixes bug 1131223

Change-Id: Ie0d365ba1ba1014bdd2bfc944123c17c4e415d6e
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
Fixes live migration with attached volumes issue

Fixes Bug: 1140917

Live migration fails when there are volumes attached to the instance

Change-Id: I27b39ac41e97840d2a60006b1c74f6d256bc53b7
Updating powervm driver snapshot with update_task_state flow

Fixes bug 1136359

Without this change snapshot still works but instance task state
does not get updated correctly and nova logs will show expected
task state erros from compute manager.

Also added a snapshot test.

Change-Id: I0f4ed24aa82a66fafc4b6813d017618ae07b4751
Fixes disk size issue during image boot on Hyper-V

Fixes bug: 1135155

The local root disk size provided in the instance flavor was not properly
taken into account in the Hyper-V driver, this patches provides a
fix for this feature.

In order to resize VHD images with differencing disks (CoW), the cached
base disk is copied to a new file, which is resized to the size
specified in the flavor and cached. This is necessary due to the fact that
differencing VHD disks cannot be resized.

The procedure described above is applied during image spawn, resize and
live migration as needed.

Trying to spawn an instance with a local root disk size smaller than the
image VHD max. internal size will result in an error.

Change-Id: I04f18f0e25c92ed1e1f9f6f18750329a3f9f1711
Fix an error in compute api snapshot_volume_backed bdm code

Stumbled upon an error similar to the one found in
https://review.openstack.org/#/c/23354/ where a dbm dict
item is tried to be read as an attribute.

Looked at the next couple of lines and discovered more
cases of this error.

Updates to some api tests that contain faulty fakes that
hide this error adds some coverage for this error. Rebased
this patch on the above mentioned review to be able to
change the tests, since the code path is the same and they
now hit both of these errors.

Resolves bug 1142734.

Change-Id: Ie639cd483334b6222085a139159da47ce6fa3671
fix postgresql drop race

when running under testr there is a chance that we enter
reset_databases for the postgresql tests at the same time for both
general and baremetal tests. In this case the pg admin commands
could fail, as pg gets really strict about having 2 users trying
to do admin commands at the same time on a single database (in
this case the magic template1 db, that we need to use because
you can't drop the db you are currently on.)

Solve this by breaking out the postgresql reset case into a
seperate function and using @lockutils on it.

Change-Id: I31555ef5aae27f31daf7cbbae61072a8d7deb255
Remove unused db calls from nova.db.api

* iscsi_target_count_by_host
* iscsi_target_create_safe
* reservation_destroy
* volume_get_iscsi_target_num

Change-Id: I0c357a6398509150e7ac987826341cd1e79f0075
Imporove db.sqlalchemy.api._validate_unique_server_name method

This method is called by instance_create and instance_update.
If parameter CONF.osapi_compute_unqiue_server_name_scope is set to
'global' or 'project' then it has terrible performance.

Algorithm was next:
1) Get all instances and all connected data (5 joinloads..) in global
   (or project).
2) Compare hostname with hostnames in instances (locally)

Now:
1) Get only count of instances with same hostname in global (or project).
2) If count > 0 raise Exception.

Change-Id: I35ea121c3f906b4fff11c38bafa2ab33200bd6b2
docs should indicate proper git commit limit

The nova gate should recommend 50 characters or less for a git commit
but actually enforce 72 characters.

This patch changes the hacking.rst docs to indicate the actual limit
is 72 characters rather then 50 characters.

Change-Id: I47f1f1f1007f5744bf1fef419df7e033803b4a53
Fixes: Bug #1144840
Rename source_(group_id/ip_prefix) to remote_(group_id/ip_prefix)

Fixes bug 1144426

Change-Id: I28735aea05738487861e477aaa3b0a3cec081821
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
Merge "Remove unused db calls from nova.db.api"
Merge "Push 'Error' result from event to instance action."
Merge "Standardize the coverage initializations."