Include list of attached volumes with instance info

Fixes bug 1112998

Change-Id: I1c3eb578339aabbcfed107043f39e30daf633c4a
Extract getting instance's AZ into a helper module.

An instance's availability zone logic may used by many modules,
so move it from extend API into helper module `nova.availability_zones`.
Also add some tests for the new method.

part of bp: different-availability-zone-filter

Change-Id: I5916a0b09d5dddec338e8e36503953720dfd6bcd
Refactor nova.volume.cinder.API to reduce roundtrips with Cinder

Make cinder.API methods accept volume_id instead of the whole volume object.
This will remove redundant roundtrip to get the volume before
passing it to other methods as in fact they only need the id.

Fixes bug 1172297

Change-Id: I5e7f944c1c29b2f211ece2ef86c0959c81e806df
Handle IPMI transient failures better.

Sometimes, IPMI "power status" doesn't return either "on" or "off".
When this happens, the IPMI driver shouldn't assume what the state is,
and the baremetal driver shouldn't assume that NOSTATE means SHUTDOWN.

This patch also improves the doc strings for the IPMI driver.

Fix bug 1178378.

Change-Id: I54a5e6309f68ab8e5601e65039366d7d87c03478
Reverse path SNAT for DNAT floating-ip.

This patch applies a reverse SNAT rule to allow instances that have an
assigned floating IP to communicate with other instances in the same
OpenStack deployment, security group rules permitting. The patch
allows members of the same private network to communicate with each
other using their floating-ips in a more consistent fashion. The rule
also addresses the situation where the target is on another private
network.

This will only work for interaction between two servers that both have
floating IPs assigned to them.

Specifically, this patch solves the problem where a target server
"sees" the private address of the client. By SNAT'ing to the client's
floating-IP, the "sees" the correct reply address and the reverse
route follows the same path that an actual external connection would
take. The SNAT ONLY occurs if a DNAT occurred before hand, allowing
communication on private networks using private IPs to remain fully
private and internal. The limitation is of course if a DNAT occurs for
other reasons, there may be issues.

Resolves bug 1178745

Change-Id: I55b7131cff5fd5a2ebf826945370d4d550e74136
Fix quantum security group driver to accept none for from/to_port

The quantum security group driver did not accept none values for
from_port/to_port which the nova security group api supports. This
patch allows None values to be passed in for those params and adds a unit test.

In addition the from/to_port responses would be different if using quantum
instead of nova. This patch fixes that and adds unit tests.

Fixes bug 1176027

Change-Id: Id57e253c9dd1787ee25fc5cbb562743692d7abe4
Cells: Don't allow active -> build

Adds support for passing 'expected_vm_state' in an instance_update dict
much like the current support for 'expected_task_state'.

For cells, when the API cell receives an instance update containing a
vm_state of BUILDING, raise an exception if the instance is in some
other state.  This addresses out-of-order messaging issues that can
cause an instance to appear to have a huge delay going ACTIVE.  (A
periodic task run can later heal the state, but it can take a long
while)

Fixes bug 1180283

Change-Id: I64252b30e2596812f3b84da64b1fc8681661d7f8
xenapi: ensure vdi is not too big when resizing down

Fix for bug 1155066

This change adds some rollback into the resize disk down
code within xenapi, and reports a better error message
when the disk is too big to resize down.

On a successful rollback, the user is notified of the error
by the instance actions, rather than leaving
the server in the error state.

The user is then able to free up some disk space such that
the resize can work correctly.

Change-Id: Ibad568ab3cfb9caaf4fe002572c8cda973d501a7
Add missing tests for db.fixed_ip_*(). functions.

Added new tests for fixed_ip*() functions.
Function fixed_ip_create() should return FixedIp instance rather than
FixedIp.address, because it is used in a tests later.
Fix calls of fixed_ip_create() respectively.

blueprint test-db-api

Change-Id: Id5e9d4486605bde9d9fd1e631d868603a7a7c604
Merge "Handle IPMI transient failures better."
Merge "xenapi: ensure vdi is not too big when resizing down"
Merge "Include list of attached volumes with instance info"
Merge "Extract getting instance's AZ into a helper module."
Merge "Refactor nova.volume.cinder.API to reduce roundtrips with Cinder"
Merge "Cells: Don't allow active -> build"
Merge "Fix quantum security group driver to accept none for from/to_port"
Merge "Reverse path SNAT for DNAT floating-ip."
Merge "Add missing tests for db.fixed_ip_*(). functions."
Remove openstack.common.version.

Change-Id: Ieb9ac3c2ce85777a33a2e15640670d03b2e7d2b7
Sync rpc from oslo.

Sync some trivial Python 3 compatibility and pep8 improvements from oslo.
I just want to have this in sync so that pulling in a feature I'm working
on comes in without unrelated changes

Change-Id: I13fcb0bd538a153b90acf0b18497e335a64dc9d1