Should not delete active snapshot when instance is terminated

The instance might be deleted when doing snapshot, need to check
whether the snapshot is active state before delete it.

Change-Id: Ic12b8dfd05ad7f36831dd073cef746f094d8f2d0
Closes-Bug: #1329882
Reduce unit test times for glance

The class TestGlanceApiServers did not inherit
test.NoDBTestCase.

Change-Id: Ieafe300d793685f5b146999383695733eba3da19
Merge "Add helper functions for getting local disk"
Merge "Make check_instance_shared_storage() use objects"
Create lvm.py module containing helper API for LVM

Currently there are some LVM API calls in 'nova/virt/libvirt/utils.py'
and also many other APIs are there.
To make a role of the code be clear, I would like to suggest to
create 'nova/virt/libvirt/lvm.py' and move APIs which are related
to LVM to lvm.py.

Change-Id: I4d80f574631d52012152c72d1db3069dd57a5550
Signed-off-by: Mitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Implements: blueprint lvm-driver-for-shared-storage
Merge "Attach/detach interface to paused instance with affect live flag"
Make remove_volume_connection() use objects

Changes the remove_volume_connection() method in compute manager
to take objects.

Related to blueprint compute-manager-objects-juno

Change-Id: I4fabee87df409accd947db3d5b429f7e871c2d60
Log exception if max scheduling attempts exceeded

This logs the last exception seen by the scheduler to help troubleshooting.

When an administrator shows an errored instance, the fault reported is
NoValidHost which is easily misread as insufficient capacity.

This is currently covered by tests.

Change-Id: I636ec9809ded2d4e3404c1f13e0d7635b9826bfe
Add new fields to the networks table

Adds a migration to add mtu, dhcp_server, enable_dhcp, and
share_address to the networks table. The field for dhcp_server defaults
to gateway, since gateway is currently used to determine the
dhcp_server value. The value for mtu and share address is determined by
a flag, so copy the value from the flag into the table during the
migration.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: I8278fb125e6e478b519c875eca9ebbf778d88d74
Adds network fields to object

Adds mtu, dhcp_server, enable_dhcp, and share_address to network
objects and provide data migration on save.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: I318791a9d7f53534b3383221cdfb7dfe63dd116b
Set reasonable defaults for new network values

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: Ic9c60071480abc5fced04dab5fc79ea44db1e10d
Determine shared ip from table instead of flag

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: Id7c6620704fef504d23cb42c5218251fa9e2dba7
Don't replace instance object with dict in _allocate_network()

The compute manager _instance_update() method returns a dict
version of the modified instance.  allocate_network() is the only
method which uses this return value rather than ignoring it, which
has the side effect of replaces the instance object it has been passed
with a dict.  None of methods called after this update need the modified
state values, so we can just ignore the return value as all of the
other calls do.

Passing on an object instead of a dict allows us to clean up the
system_metadata handling in _alloc_network_async() as well.

Related to blueprint compute-manager-objects-juno

Change-Id: I3249bba03edab4dd45eec72f7abdb15d7800346e
wrap_instance_event() shouldn't swallow return codes

The wrap_instance_event() function, when used as a decorator,
will currently swallow return codes.  This prevents it from
being used on a function that returns a value that the caller
actually cares about.

Change-Id: I72616b0afcd3ab8fae81742bf4b7754cd959ef3a
Closes-Bug: 1311793
Instance and volume cleanup when a build fails

On failed builds the _shutdown_instance method used to get called which
would clean up leftover instance artifacts, volume attachments, and
networking.  This no longer happens which is causing volumes to be left
in an attached state when they're not attached to anything.

Network deallocation is already handled in this code path so it should
not happen in _shutdown_instance.

Change-Id: I899b64ac5941acc282ccae7e1963d6f714c01e8b
Closes-bug: #1332198
Not count disabled compute node for statistics

No server will be scheduled to disabled compute service, thus we
should not count the corresponding compute node information.

It's arguable if we should count for 'down' service, since service
may be marked down because of communication error. If we do want to
exclude the down service, we need passing the information from caller
because the up/down state is not kepts in database, and it means compute
and cell api changes.

Closes-Bug: #1285259

Change-Id: I5e3e71ef30683c5eb5cc4462f58fa5f29d7c3f4b
Merge "Deprecate glance_* configuration settings"
VMware: remove unused code in vm_util.py

Remove a few functions not used anymore and not tested. This increases
the code coverage and decreases the time devs scrolls through the file.

Change-Id: I8398bceb8771d9c180bcd6cbafbf1f3e839f9307
Merge "wrap_instance_event() shouldn't swallow return codes"
Merge "libvirt: Remove use of db for flavor extra specs in tests"