libvirt fix resize/migrates with swap or ephemeral

Fixes bug 1191608

The code was not properly guarding against backing files not
existing with QCOW2 images. As such, get_disk_backing_file() would
return None, then the subsequent call to basename() on None would
cause an exception.

This bug was introduced with the fix for bug 1185588 and commit
6e768363.

Change-Id: I4b1237ddf01b9398bfdc141180260136b36cae5a
Preserve network order when using ConfigDrive

Pass network_info to be used by InstanceMetadata instead of fetching
it by API and losing originally requested network order. This is
similar to what has been done for "content" where the original data
is lost after the initial call.

This issue only affects the ConfigDrive code path as the original
network_info is used when using file injection.

HyperV and XenApi are still probably affected by the bug but
unaffected by this fix. The fix is the same for these drivers. Simply
pass a network_info and it will be used instead of fetching the
network info by API.

Change-Id: Ie673b725cb47bf491009db99f6cb1258d46b0a69
Fixes: bug #1156844
Sync models.Console* with migrations.

Blueprint: db-sync-models-with-migrations

Change-Id: I2cceab6484b6d69b3f1aa1492e49d76a765b758d
Make sure periodic cleanup of instances continues on error

If an instance cleanup fails with an exception, no more instances
will be cleaned up. If the failure is permanent, this will block
other instances from being cleaned up for as long as it remains.

Resolves bug 1192712.

Change-Id: Ibdd69817ee0e6d0963637f38a8be3949e6e053ed
Xenapi shutdown should return True if vm is shutdown

clean and hard shutdown vm methods return a False if the vm
is currently shutdown. It should return a True, so that its
return value can be used to determine if the vm is shutdown
or not.

Fixes: bug #1195587
Change-Id: I758c43d45b15c3ef231e9eee3ecac620a44db824
xenapi: Tidy up Popen calls to avoid command injection attacks

 * Rewrite xenhost._run_command and xenstore._run_command to use
   utils.make_subprocess and utils.finish_process
 * Change exception raised by utils.finish_process to retain information
   needed by calls in xenhost and xenstore

Change-Id: Idcdb50bededf0acde92f1774d6752043ba8f97ce
Fixes: bug #1074087
Export just the volume metadata for the database to be populated

Change I8c01ba3 retrieved the metadata from Cinder, however it did
not format the output correctly resulting in the metadata being lost
between Cinder and Nova.

This patch fixes Bug 1175571 correctly, ensuring that metadata is
transferred from Glance images to Cinder Volumes and on to Nova
instances.

Change-Id: Ie3a688e6bff539e09ec705ed901534f5829cf167
Update openstack.common.config

Change-Id: I8f0112e760ba8376438738196234f5eb10b4e246
Port extended-availability-zone API into v3 part1

This changeset only copies the v2 files into the appropriate v3
directories unchanged. The copy as-is will not be loaded by either
the v2 or v3 extension loaders. The second changeset will then
make the changes required for it to work as a v3 extension.

This is being tried in order to make reviewing of extension
porting easier as gerrit will display only what is actually
changed for v3 rather than entirely new files.

Partially implements: bp v3-api-extension-versioning

Change-Id: I531a2d2f68a268d44eaef3a5af0a9c799787b188
Imported Translations from Transifex

Change-Id: Ib227bc8a4d27364e04374dbeb44f43f85e4d112b
Disassociate fixed IPs not known to dnsmasq

Currently, fix_ip disassociation only happens in release_fixed_ip(),
which is called by dhcp-bridge script when ip is released. But there
are circumstances when instancs fail to get lease from dnsmasq(instances
fail to boot or instances fail to spawn). In such case, DHCPRELEASE
packet sent to dnsmasq would never trigger dhcp-bridge to run. Thus the
fixed ip would not be disassociated from instance until
_disassociate_stale_fixed_ips() begins to run.

Actually, this patch borrows the idea from Vishvananda's
3f6739e2a8acdf20d01c0b5039a33f26d879587b commit: explicitly disassociate
fixed ip which is not known to dnsmasq, instead of via the dhcp-release
script.

Steps to reproduce:
1. Create an instance which doesn't send dhcp request to dnsmasq.
2. Delete the instance.
3. The fixed ip associated with the instance is not returned to pool.

Bug 1180766

Change-Id: Icc022ea2fb7af08fb7354e3a49c77ad5ae58f34c
Merge "Imported Translations from Transifex"
Port admin-actions API into v3 part1

This changeset only copies the v2 files into the appropriate v3
directories unchanged. The copy as-is will not be loaded by either
the v2 or v3 extension loaders. The second changeset will then
make the changes required for it to work as a v3 extension.

This is being tried in order to make reviewing of extension
porting easier as gerrit will display only what is actually
changed for v3 rather than entirely new files.

Partially implements: bp v3-api-extension-versioning

Change-Id: I11fd86cffb45851006338f8b6d2f87dad3aef467
port Service API into v3 part1

This changeset only copies the v2 files into the appropriate v3
directories unchanged. The copy as-is will not be loaded by either
the v2 or v3 extension loaders. The second changeset will then
make the changes required for it to work as a v3 extension.

This is being tried in order to make reviewing of extension
porting easier as gerrit will display only what is actually
changed for v3 rather than entirely new files.

Partially implements: bp v3-api-extension-versioning

Change-Id: Ia44030ac56cb09e4303900a178194127ae8e9a31
List migrations through Admin API

The os-migrations extension exposes endpoint to fetch all migrations.
The migrations can filtered by host and status. If cells are
enabled migrations can be listed for all cells or can be filtered for a
particular cell.

The route for fetching migrations for
a region is - v2/{tenant_id}/os-migrations. Filters can be passed as
query parameters -
v2/{tenant_id}/os-migrations?host=host1&status=finished&cell_name=Child

DocImpact

Change-Id: Id70dbece344a722b2dc8c593dd340ef747eb43d3
Implements: blueprint list-resizes-through-admin-api
Port extended-server-attributes API into v3 part2

Ports the extended-server-attributes extension and the corresponding
unittests to the v3 framework.

Partially implements blueprint nova-v3-api

Change-Id: I33e227de0e4d3e1e5f52ca79157e3846a0e6ee13
Ensure flake8 tests run on all api code

We need to exclude the plugins/xenserver directory
because the python2.4 code can't use as in except clauses.
The existing exclude directory accidentally included some
code in nova/api/openstack/compute/plugins and the related
tests. This code is now included in the flake8 tests,
and the current violations have been fixed up.

Fixes bug 1197858

Change-Id: Ib5f1b65d5d793f0f5854e898ca3ce751e43ef233
Merge "Port extended-availability-zone API into v3 part1"
Merge "Preserve network order when using ConfigDrive"
Merge "libvirt fix resize/migrates with swap or ephemeral"