Completes the power_state mapping from compute driver and manager

Fixes bug 1166906

Added extra states to constants module together with test
cases checking every state map.

Also added some debug statements under blockdev and operator
to be able to spot obvious issues with images at deploy time.

Change-Id: I77ebb4d417a3875b761f5fb220d9274b79611ff0
Allow listing fixed_ips for a given compute host.

nova.db.fixed_ip_get_all_by_instance_host was removed in commit
bb867ce3948ddc23cf928ca3dda100a1a977896a, but was still used in
nova-manage. This patch works around the removal of the foreign
key that led to this method being removed.

Resolves bug 1163660.

Change-Id: Ieccd37c752e245558827615c098604d11ad3d945
Import and convert to oslo loopingcall.

Import the oslo looping call implementation (which is a copy of
nova's), delete nova's local copy, convert all users to the new
location.

It should be noted that the oslo implementation of
FixedIntervalLoopingCall measures time from the start of the
periodic task, not the end, so periodic tasks will run with a
constant frequency instead of the frequency changing depending on
how long the periodic task takes to run.

Change-Id: Ia62ce1988f5373c09146efa6b3b1d1dc094d50c4
Map internal S3 image state to EC2 API values

Fixes the EC2 API so it maps internal S3 image state values to
ones defined by the EC2 API rather than returning the internally
used values.

Fixes bug #1074904

Change-Id: Iabbda0e5fcbe4d572c76367c6f98d4bece050e73
Fix up regression tester

* Clean up to support pydoc
* Support -h
* Make it actually work
* Improve docstrings
* Add copyright

Change-Id: I977df71e8213e39e9eebf9cc56b2dd7625959870
Translate NoMoreFloatingIps exception

When the pool of floating ips is exhausted the NoMoreFloatingIps exception
is raised but not handled properly in the floating ips extension resulting
in the exception propagating further up and causing a stack trace to be logged.

This change translates the exception explicitly into a HTTPNotFound, preserving the current
REST API behaviour. It fixes a bug where the pool name was not correctly inserted into
the message returned if allocation from a specific pool was requested.

Fixes bug 1169811

Part of blueprint no-stacktraces-in-logs

Change-Id: I8f35d25d065bb1fa709cff6f59841ac8c86658bd
Remove unnecessary full resource audits at the end of resizes

Both confirm_resize and revert_resize ends with full resource audits
which is unnecessary, given that correct calculations can be made
using existing claims.

Resolves bug 1169982.

Change-Id: If0f91651605a95e73fdbf88aa18c279bfaf73b04
Fix ec2 CreateVolumes/DescribeVolumes status

In admin context CreateVolumes/DescribeVolumes returns
extraneous information such as project_id, host, instance
data etc. This results in output which is not compatible
with the ec2 API. This change removes the addition
of the extra information.

This only partially fixes bug #1074901 as mapping the internal
volume states to ones specified by the ec2 api results in the devstack
euca.sh exercises to fail. But that can't be fixed until the fix
in this patch is through as the extraneous information returned by DescribeVolumes
causes euca-describe-volumes to not to show the attachment state for
a volume which is needed by the euca exercises.

Change-Id: I48a96fbfe4bb2e3da9514d688638ecdf3a168303
ec2 CreateVolumes/DescribeVolumes status mapping

'attaching' and 'detaching' are not valid ec2 API volume status
values. Instead map them both to 'in-use'.

Note this will not pass the devstack exercises until
https://review.openstack.org/#/c/27244/ goes through

Fixes bug #1074901

Change-Id: Id3dfd525d24d622aab5e350e42713fdb7671b31e
Add unit tests for /db/api.py#fixed_ip_*

Implements: some tests for db methods fixed_ip_* for blueprint db-api-tests
Change-Id: I51fe24600b7df2b529350ad70939a01f60bd3c9c
Fix fixed_ip_count_by_project in DB API

Fix "by project" filtering in fixed_ip_count_by_project
method of SQLAlchemy DB API implementation.

Fixes: bug #1171161
Change-Id: Id408aba6db4dd953945feba36d17b056266ca4b7
Add an rpc API common to all services.

This patch adds an rpc API that is exposed by all services.  The methods
in this API exist in their own namespace and are versioned independently
of the main API for the service.

The first method for this API is a simple ping() method.  This method
exists in the conductor rpc API already, and could be more generally
useful.  Other methods will be added in later patches.

The base rpc API will be exposed from all services automatically unless
they override the create_rpc_dispatcher method in the base manager
class.  All services need to pass a service_name into the base manager
constructor.  Some services already did this, but now it's needed for
all of them.

Implements blueprint base-rpc-api.

Change-Id: I02ab1970578bc53ba26461b533d06d1055c2d88e
Deprecate conductor ping method.

Deprecate the ping() method of the conductor API in favor of the one
that comes with the base rpc API.

Part of blueprint base-rpc-api.

Change-Id: Iea46b7f6ce70f4919d0121433af2fd64d6346941
Support FlatDHCP network for VMware Hyper.

fix bug #1171783

Change-Id: Ibb75c8e3174283f0f5e94bacfd61ee93e8bd6227
Fix powervm driver resize instance error

During a resize operation in powervm, the logical volume
of the instance will be copied and compressed to a file.
Current logic decompresses it twice before copying this file
to a new volume which will cause the new instance to not
boot properly.

Fixes bug #1169848

Change-Id: I91f536919511aafbf7dbe14abbee48dbceb189b2
Add missing test for db.instance_type_destroy method

This test checks that if there is no such instance_type
then is raised exception.InstanceTypeNotFound

blueprint db-api-tests

Change-Id: I0a0db7aaefe6ac781c520e3b90958800db8fd52b
Move db.instance_type_extra_specs_* to db.instance_type_* methods

All instance_type_* methods should be one after another

blueprint db-cleanup

Change-Id: Icc69c45dbcb3dcea5f81266a11f726b5b3215e27
Merge "Remove unnecessary full resource audits at the end of resizes"
Move get_backdoor_port to base rpc API.

Each service implemented the get_backdoor_port method individually.  This
patch moves the implementation of this method to the base rpc API
instead, and removes the now unnecessary code from each of the services.
The server side method was left on all of the managers for rpc backwards
copmatibility.  They can be removed on the next major rpc version bump
of those APIs.

Part of blueprint base-rpc-api.

Change-Id: Ia8838fafd80eb86a1c2d66f5e97370042d8d8c53
Merge "Add missing test for db.instance_type_destroy method"