Add expected_errors for extension evacuate v3

Partially implements bp v3-api-extension-versioning

Change-Id: I1a36c7f6ca517b9696c90fc35ae5c0fb74975159
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
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
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
Fix extension server_meta follow API v3 rules

* add decorator expected_errors
* change 'meta' to 'metadata' for show and update that is
consistent with other actions
* use is_valid_body instead of catching AttributeError and ValueError,
because AttributeError and ValueError is too generic.

Partially implements bp v3-api-extension-versioning

DocImpact

Change-Id: Icdb353b077620c1ba690f3679dea6a8956847d36
Add expected_errors for extension instance_actions v3

Partially implements bp v3-api-extension-versioning

Change-Id: Ib9eb515363d9a83258a22381420244c752c7f0ed
Disable per-user rate limiting by default

The rate limiting enabled via api_rate_limit, is per user rate limiting
which does not protect against intentional DOS, instead DOS rate
limiting should be elsewhere. Furthermore useful values for this are very deployment
specific.

* Private deployments simply don't need it.
* Public deployments need something more sophisticated (queue depth based,
  not static values).
* Folks that do want it as belt-and-braces want semi-decent defaults
  but there is no need to default it on.

Part of more sane defaults effort.

DocImpact

Change-Id: I5451f6f90a6448c838612f180f0af750213a62bf
Use RetrievePropertiesEx instead of RetrieveProperties

Fixes bug 1183654

The fix also adds a configuration variable enabling the user to
configure the maximum amount of objects that can be retrieved by
the aforementioned function.

When using RetrievePropertiesEx the server may allocate resources
in case additional calls are made. These are addressed by reading the
extra resources using ContinueRetrievePropertiesEx (if necessary)
or CancelRetrievePropertiesEx (when the necessary result has been found).

DocImpact

Change-Id: I894d9698461b0ce22b01211fd196f6c32899a8fd
Update references with new Mailing List location

Yesterday, openstack@lists.launchpad.org was migrated with
all users to openstack@list.openstack.org.

This patch updates references to the old mailing list with the
new, to ensure that people encountering them don't accidentally
try and join the old list!

Change-Id: I76242f4f4f0c8c2418068ea709ab2f7aa4502fd5
Moves scheduler.rpcapi.prep_resize call on compute.api to conductor

This change moves the scheduler.rpcapi.prep_resize from
compute.api.resize to conductor and it calls
conductor.api.migrate_server instead.

This is part of other changes that will completely move cold
migration to conductor.

Next change will move compute.rpcapi.prep_resize and all
related logic from the scheduler to conductor.

Partially implements bp cold-migrations-to-conductor

Change-Id: I2eaff7e94c77deb03a6843f316e243b284e31666
Fix race between aggregate list and delete

Previously, during get_aggregate_list() if an aggregate was deleted
after the list of aggregates is initially read from the database
with db.get_aggregate_all() then the list method would raise an
AggregateNotFound when it called _get_aggregates_info(), which makes
additional db queries for each aggregate. This would result in the api
request receiving a 404 response. However db.get_aggregate_all()
already contained all the required information for the aggregate
list.

This commit changes renames _get_aggregate_info() to
_reformat_aggregate_info() which just correctly parse the response of
db.get_aggregate_get() and formats its response in the same way as
_get_aggregates_info() would return with the extra database queries.
This fixes the race condition not only in list but potentially in
other calls by only making one database read for any get operation.

Also, the unit tests added in this commit are to fill a coverage gap
with get_aggregate_list() and to ensure that we don't change the
behavior of list while fixing the race condition. The race condition
is not directly testable in unit tests because it requires a
multithreaded environment to send a delete immediately after a list
call. It was uncovered by running tempest in parallel with testr.

Fixes bug 1204598

Change-Id: I5f872c7ac89334fc3914906831ed8f2a58881543
Logging virtual size of the QCOW2

When we boot VM with QCOW2 which virtual size of the QCOW2 is larger than
flavor's root disk size, we cannot know virtual size in the log.

Virtual size of the QCOW2 should be logged.

Change-Id: I3ed969151525cada2208f755b0116ed0eca1bdf2
Fixes: bug #1206362
Fix timing issue in SimpleTenantUsageSample test

If POST query, which is made in test setUp(), for some reason
takes more that 1 second to proceed (e. g. high LA value), the
test will fail due to mismatch between the expected and actual
instance uptime values.

The error is quite rare, but nevertheless happens time to time
when Jenkins runs gate jobs.

Fixes bug 1206526

Change-Id: I0418ee3f852db6dd3c5ed905490be2e48c8fd0ba
Merge "Set VM back to its original state if cold migration failed"