Port cells extension to v3 API Part 1

This changeset only copies the v2 files (implementation and test)
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 done 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 blueprint nova-v3-api

Change-Id: Ie629ee328d76a1595350b597c7874b430217c769
Port fping extension to v3 API Part 1

This changeset only copies the v2 files (implementation and test)
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 done 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 blueprint nova-v3-api

Change-Id: I55d15ab5f9f59a83dc67bac2d2f41ceee06085d5
port Simple_tenant_usage  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: I1618987cc905a6734b409eb9a7fe37c65b6aac28
Remove junk file when ftp transfer failure

During spawn with powervm driver, the image transfer to the IVM host
may fail in some conditions, eg. IVM host doesn't have enough disk
space. It leaves the junk file in IVM host, and this will disturb
next spawn after resolving environment issue, need clean it.

Fixes bug #1188884

Change-Id: I7b8d719995c2702c89cf55cef5f34bde9d01c1b9
Port hypervisor 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: I251dc18dda9756574c308a08423fd805a3e91182
Port extended status extension to v3 API Part 1

This changeset only copies the v2 implementation file into the
appropriate v3 directory 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 done 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 blueprint nova-v3-api

Change-Id: Ia5b80b70a7a459bf973de1c1aea8dc650e763b8d
Port extended-server-attributes 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: Idc9eed087a82f897d504a5c79e520883e537d060
Remove usage of locals() from powervm virt package

Fixes bug 1171936

Change-Id: I9ff8c392071102737c70a807f9bfc584729c4142
Fix the filtered characters list from console-log

In fffcaea1 ^M was added to the list of characters to filter from the
console-log output but, because of a typo in the regexp, the
character '-' was added to that list too and has been removed since
then.

Fixes bug #1194032

Change-Id: Ia02b0b4c7027cbd09a51042ca1b5d28890413626
Sync db.models and migrations.

This patch syncs models with migrations for:
- DNSDomain
- AggregateMetadata
- BandwidthUsage

Blueprint: db-sync-models-with-migrations

Change-Id: I09c48bac5ed780a7ec1b89cc8ce0684f4903d9dd
Skip security group code when there is no network.

This patch adds a simple check to the nova/quantum API that immediately
returns an empty list if there are no configured networks available.

Fixes bug 1191044

Change-Id: I34ac4dd56c71f99c7ed9ff632d6dc7036d91008d
Fix types in test_ec2_ids_not_found_are_printable

This test fails on PostgreSQL when trying to compare
the VolumeIdMapping.id column (Integer) with a passed
string value.

Blueprint: db-api-tests-on-all-backends

Change-Id: Ie529d25029667a5279f9c70f0f3f081b87fb6acb
port Attach_interface 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.

Change-Id: I83803ed04f39cb7dda537d08d34e78a04cd64d4c
Update instance properties values in child cells to create instance.

When using nova cells, in child cell, instance properties dict received
from API cell is returned by database that contains instance['name']. We
need to pop this from dict before creating a instance entry in child cell.

The system metadata also need to be recreated in child cell because instance
properties dict is converted to primitive which makes instance['system_metadata']
a list of dicts.

Fix bug #1193552

Change-Id: I43a8b4c1673a831b0c87881004eb0a7e5b149d9e
Fix for failure of periodic instance cleanup

The periodic task to identify and (optionally) delete instances which
are running on the host but marked as deleted in the nova database currently fails
if the option to delete is selected.

This failure is because the instance data returned from the query in
nova.compute.manager:_get_instances_on_driver does not include the system metadata
expected by nova.compute.flavors:extract_instance_type.

This change alters _get_instances_on_driver so the calling function can specify
columns_to_join which is used in the call to instance_get_all_by_filters (leaving
this set to None, rather than [] as it is currently, joins the default columns which
includes the required system metadata).

bug: 1190206

Change-Id: I44aecebdb4d0e20e52fdd59b46a022483cdd19d5
Report the az based on the value in the instance table.

When attempting to find the availability zone of an instance
do so by first trying to locate the availability zone of the
host the instance is active on. If that fails then attempt
to use the value that is in the instances 'availability_zone'
key instead.

For the caching used in the availability_zones module there
was a new method added to get and reset the cache that is
useful for unit tests, since during each run of a test you
do not want to be affected by something in cache from a previous
test.

Fixes bug 1172246

Change-Id: I6f54a44cc87434120656ccc789cebcc08d434418
xenapi: Remove vestigial `compile_metrics` code

`compile_metrics` is no longer called as it was superceded by:

    https://github.com/openstack/nova/commit/8887f10c66bca248f289db8f834ae8f36f9a03a1

Fixes bug 1194990

Change-Id: Ia651ac69fc38ed3f5cb29562556f7065caba225a
Port Simple_tenant_usage API to v3 Part 2

This patch contains the changes required to adapt the Simple_tenant_usage
extension and the corresponding unittest to the v3 framework

Partially implements: bp v3-api-extension-versioning

Change-Id: I2db66704a77e822543e270773acc847267ef6ece
Port server password extension to v3 API Part 1

This changeset only copies the v2 implementation file into the
appropriate v3 directory 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 done 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 blueprint nova-v3-api

Change-Id: I8be578ed4fada25ec4a8aa8adb3addb0a3791f85
Fixes for quota_sets v3 extension

Various fixes for the quota_sets v3 extension:

* Removes reference to ext_mgr as this is a v2 concept and causes
  the extension to fail to load

* Merges os-extended-quotas extension which was just used as a switch
  by it being loaded or not and didn't contain any content itself. The
  extension presumes the functionality is always enabled. This means
  that the force paramter must now always be passed if the client
  wants to set the new quota lower than what is already used and
  reserved

* Updates test suite and consolidates tests given extended quotas is
  no longer a separate extension

Partially implements blueprint nova-v3-api

Change-Id: I868636b526a5990f96e63168d50c2d894ed33d52