Fix v3 hypervisor extension servers action follow REST principles

The orignial hypervisor servers action as below:
'/os-hypervisors/[filters]/servers'

Change it as:
'/os-hypervisors/[hypervisor id]/servers'
And tt will return all the servers on the specific hypervisor.

Partially implements: bp v3-api-extension-versioning

DocImpact

Change-Id: I6c252372af67eda79f670199deb6592c02603c33
XenAPI: Refactor Fake to create pools, SRs and VIFs automatically

Required for changing the default SR to be the pool default - see
I116f65ece94f839e63b085480ba4f8974119d2bb
This also fixes some minor bugs in fake.py shown up by the tests

Change-Id: I19fc0747648b97a0912d28008981a84f70107d7b
Add expected_errors for extension evacuate v3

Partially implements bp v3-api-extension-versioning

Change-Id: I1a36c7f6ca517b9696c90fc35ae5c0fb74975159
Use valid IP addresses values in tests

Currently we use strings like 'fake_address', 'localhost', etc
as IP addresses values in DP API tests. This works great when
running tests on SQLite or MySQL backends, where IP addresses
are stored as plain strings. But in PostgreSQL there is a special
column type (INET), which checks inserted values to be valid IP
addresses, so tests fail.

This patch ensures we use valid IP addresses values instead of
arbitrary strings in DB API tests.

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

Change-Id: I2026bab612fcac09b245f6745810b6200f1f2443
Change EC2 client tokens to use system_metadata

An EC2 client token is created as a result of RunInstances. The initial
implementation called create_tags which uses per-instance metadata.
However, we can't update per-instance metadata while an instance is still
building because put the metadata updates in the messaging queue.

We avoid this problem by using system_metadata instead of per-instance
metadata. As an added bonus, users can't tamper with the token via the tags
API.

Fixes bug #1202404

Change-Id: I8ff28d75154a30fe3b521926453b9e9cbdd9fead
Config drive attached as cdrom

Some guest OSes (e.g. Windows) require config drive to be a cdrom device
to access the iso9660 filesystem on it. Option config_drive_format is
therefore set to also control the device type of config drive. If it's
set to 'iso9660', config drive will be cdrom; if it's 'vfat', config
drive will be disk.

DocImpact
Fixes: bug #1155842
Change-Id: I6c08b1b8040a1fd0db8e2b3b1fc798060733001f
Implements host uptime API call for cell setup.

Fixes bug os-hypervisors/<id>/uptime fails in cell setup.Implements
'get_host_uptime' for cells_api, which returns hypervisor uptime
from the target child cell.

Fixes bug LP 1192911

Change-Id: Iac75e46e565f17c91117dcb810f6d2f2e62708d8
Raise exception if both port and fixed-ip are in requested networks.

When both fixed-ip and port (uuid) are specified as part of the
request during server creation, the user specified fixed-ip must
be ignored because it has already been allocated for the port. For
compute osapi v3, we raise a BadRequest Exception to ensure the user
understands why he/she is not getting what he/she asks for.

This patch also address some minor nits in other error messages.

Fixed bug #1190777

Change-Id: Iaf606637a8acf9d20fc6cae0bed5c9a3ea0bf611
Revert "Add requests requirement capped <1.2.1."

Fixes bug 1182271.

This reverts commit c39687edb9138c6eac675b8781a5d4bf5a51c968. The
original workaround is no longer needed, as pip is now configured to
install with the --upgrade flag and will therefore pull a new enough
python-jinja2 into the tox virtualenv even though site packages is
enabled in nova and an older distribution package of the same
library is still present on CentOS 6.4.

Change-Id: I33335314c7c1b26d630137edfa0cdc2d1947432e
Fix flavor v3 follow API v3 rules

* Change the parameter naming style for index and detail
* Add decorator expected_errors

Partially implements bp v3-api-extension-versioning

DocImpact

Change-Id: Iae6fd27e665388f4e6b24a3685ea7ed39e78a89d
Merged flavorextradata extension (ephemeral disk size) into core API

Partially implements blueprint nova-v3-api

Change-Id: I03ff8661f1b98fb25399ed230da79fcd94014312
Fix extension rescue follow API v3 rules

* Add decorator expected_errors
* Change 'adminPass' to 'admin_pass'

Partially implements bp v3-api-extension-versioning

DocImpact

Change-Id: Ibfc78801bf91768c62f2b055e4f663396d66f66d
Make ServerXMLSerializationTest DRYer

Move server's description info to setUp() to get rid of duplicate data.
Make user's and admin's attributes static class variables and
extract function which checks obligatory admin/user attributes.
Extract function which checks amount and values of fields in XMLized result.

Blueprint: nova-tests-code-duplication
Change-Id: Iffaec9555476cb8006130ec97f455d7810815970
Add expected_errors for extensions services and server_password v3

Partially implements bp v3-api-extension-versioning

Change-Id: I7e265eef705c2bba9cd9b22b1ff9076859496ee8
Set VM back to its original state if cold migration failed

If migration of a VM in the SHUTOFF state failed due to
NoValidHost, the VM was erroneously set to ACTIVE.

The fix sets the VM back to its original state instead.

Fix bug 1204905

Change-Id: I06f6a2e8a05e715c505a24d3013f482eaea3df8b
Fix HTTP response for PortNotFound during boot

If a non-existent Quantum port is passed as a network parameter during create
instance, Nova API should return an HTTP BadRequest.

Fixes bug #1195468

Change-Id: I5914fda076fdd3ff20c81984364ca725edae1a78
Clarify instance_type vs flavor in nova-manage

Make it clear that we are only using the term flavor now.

Partially implements bp flavor-instance-type-dedup

Change-Id: Ic26349d70fd99a20635f3ae45041c66b300a0513
Add note why E712 is ignored

According to the commit message in
560e5cd84ef2c1a6427c78d35eedc66445e1f77f we ignore E712 because '
With this change we ignore E712 since it is normal to use
"column == True" in sqlalchemy.'

Add note in tox.ini explaining this.

Change-Id: I393e13b1430aae46f958311875678bd99e17b13c
Add expected_errors for extension_info V3

Partially implements bp v3-api-extension-versioning

Change-Id: I39a72f7765f2cd652b8fbe4a9f7009fe4072d959
Add expected_errors for extension cells V3

Partially implements bp v3-api-extension-versioning

Change-Id: Iae888a84a799edfe2991221ff1083b6acd004e48