Add POWERVM_STARTING state to powervm driver

In current implementation in powervm driver, the 'Starting' state
of an instance is not supported. This patch adds this to the powervm
driver and allows execution to continue until the instance is in a
'Running' state instead of failing out.

This patch fixes Bug #1084641

blueprint powervm-compute-enhancements

Change-Id: Ieb17b215547e77ee8d13b18496ba4090fc45757b
Add vpn ip/port setting support for CloudPipe

This extends the cloudpipe REST API to allow the setting of the IP and port
for the VPN for each network in the project

/v2/{tenant_id/os-cloudpipe/configure-project # POST ip/port

This forms part of the work to provide APIs for functionality currently
implemented by nova-manage that needs direct db access so nova-manage
can eventually be removed

DocImpact
Implements: blueprint apis-for-nova-manage

Change-Id: I416c0bfbe1c88470638f1c2004d1dcaeb51a6c41
Fix test_migrations for postgres

Fix creating .pgpass file that is used to connect to postgress database without
password prompt.

Fix command that execute SQL in postgres DB:
a) there were no spaces between command options and values
b) we can't drop database while we are connected to it. There is a special
database `template1` in postgres for dropping databases.
c) using `'` instead of `"` in bash to quote SQL expressions because bash
interprets only text in single quotes as plain string.

Remove SQL requests which lock database

Fix stripping password, so it works not only when password contains only
spaces.

Change-Id: I753a044aba8579b0f4225b4e67163d046ec1a32e
Use elevated cxtx in resource_tracker.resize_claim

Updates the resize_claim function in compute/resource_tracker
so that it uses an elevated context for the db.compute_node_update
call.

This fixes an issue where resizes from non-admin users would fail
to complete.

Fixes LP Bug #1085071.

Change-Id: I356e564228603834073c2b878b09cc35b88edf1e
Merge "Add POWERVM_STARTING state to powervm driver"
Merge "Add vpn ip/port setting support for CloudPipe"
Merge "Fix test_migrations for postgres"
Merge "Use elevated cxtx in resource_tracker.resize_claim"
Split out part of compute's init_host.

The init_host() function in the compute manager has grown a good bit.
The amount of nesting for instance initialization was pretty deep,
making it a bit ugly.  This patch splits out the code for initializing
an instance during the service initialization and puts it into its own
function, making things a bit more readable.

Change-Id: I5183baa76304bfc04af3c7347218eefbc3dc84e3
add metadata support for overlapping networks

implements blueprint metadata-overlapping-networks

This is the Nova side of the changes required to support Metadata
service on overlapping Quantum networks. This change is BACKWARDS
COMPATIBLE and does not require any new configuration for Nova only
deployments.

Change-Id: I4dacd565e43e136e3faeb95184a4a2f7188415cd
Merge "Split out part of compute's init_host."
Merge "add metadata support for overlapping networks"
Fix rpc control_exchange regression.

A change was made in rpc that requires project's to define the
control_exchange option themselves.  This was so the project's could
set their own default value.  This change has made it in to nova without
adding the control_exchange option, meaning that it is using the default
of 'openstack', potentially conflicting with other projects.

See https://review.openstack.org/#/c/12518/

Fix bug 1083944.

Change-Id: Ifc00a537c4ee327cbee91fe1d911f8c402e350b7
Reset volume_api before cinder cloud tests.

If tests are not run in the default order nosetests runs them in it is
possible that volume_api in test_cinder_cloud.py is in a state
unsuitable for testing. Reset the volume_api before each test to ensure
volume_api is usable for every test run regardless of test order.

Part of blueprint grizzly-testtools

Change-Id: I974e9eb09cbf9f19a01ecd0f13b2664291a5609e
Reset notifier_api before each test.

If tests are not run in the default order nosetests runs them in it
is possible that notifier_api in test_notifications.py and
test_compute_utils is in a state unsuitable for testing (notifier_api
may have had its drivers set elsewhere preventing it from picking up the
test driver). Reset the notifier_api before each test to ensure
notifier_api is usable for every test run regardless of test order.

Part of blueprint grizzly-testtools

Change-Id: I1f9282b96e2b2471eb8176b7ce9c95b4b1548ffe
Open test xenapi/vm_rrd.xml relative to tests.

The test xenapi/vm_rrd.xml file was opened in test_xenapi.py relative to
the current working directory. This forced you to run unittests out of
the nova/tests directory. Open the xenapi/vm_rrd.xml relative to the
test_xenapi.py file so that the current working directory does not
matter.

Part of blueprint grizzly-testtools

Change-Id: I2b8720ea418e10e9748adaa599513794202351e6
Patch fake_libvirt_utils with fixtures.MonkeyPatch

If tests are not run in the default order nosetests runs them in it
is possible that the monkey patching of fake_libvirt utils is not
properly cleaned up. Use fixtures.MonkeyPatch to monkey patch
fake_libvirt_utils in test setUp ensuring the monkey patching is
reverted properly after each test.

Part of blueprint grizzly-testtools

Change-Id: Ie691cbc777c01fa8a5affa3271f36776ea9648b9
On confirm_resize, update correct resource tracker

On confirm_resize, update the resource tracker based on the source
node of the instance, not the destination.

bug 1085325

Change-Id: I041fc27225a8ed8e61fe21945d9241377b1d6384
Merge "Fix rpc control_exchange regression."
Merge "On confirm_resize, update correct resource tracker"