Fix divergence in attach_interfaces extensions

I pointed out in revision 7 of Ibe4cbd025700aa0d73a6d4d19fbf8f0005509428
that it we shouldn't use a different variable name in the identical code
shared between the v3 and v2 extensions, but that was never fixed before
merging.

Change-Id: I7c2853db2cbad30a37efd98947ebe687b37bfbe8
VMware: fix bug with booting from volumes

When booting from a volume without an image reference would cause
an exception.

Change-Id: Ib0302197b8d4f5e054a8c4426cb0dde7cb82842e
Closes-bug: #1235022
Fix status code of server's action confirm_resize for v3

The status code of confirm_resize should be 202, but it
returns 204 now. That because it returns HTTPNoContent
that overwrites the status code of decorator 'wsgi.response(202)'

And adds API samples for confirm_resize that used to test
the status code of confirm_resize.

Partially implements blueprint v3-api-unittests
Closes-bug: #1233561

Change-Id: I50a3046866af0a1efdb5c41ded40f973b02843e8
catch exception in start and stop server api

this catches exception.InstanceIsLocked in start and stop
server api.

Closes-Bug: #1233026

Change-Id: Ibb882178ab0770837702d503ef88c6510072e33f
baremetal: Use network API to get fixed IPs

Previously baremetal volume driver used DB API to get fixed ips and
DBNotAllowed was raised.

Change-Id: Ie2281311af1b60f55b5b719a2e2df6316bbaa9f6
Partial-Bug: #1208707
baremetal: Add missing method to volume driver

Added get_hypervisor_version(), which is called by underlying
LibvirtVolumeDrivers. Also added tests roughly checking if the
underlying drivers can be loaded and be called without error.

Partial-Bug: #1208707
Change-Id: Ida6b6800d1ef518c6e76d6b2ab4ac2f795a744ca
Fix error message of os-cells sync_instances api

Because parameters of this api are 'updated_since' , 'project_id'
and 'deleted',add 'deleted' to the message "Only 'updated_since'
and 'project_id' are understood."

Change-Id: Ic2b2314861030b029be5df490e123d8976711193
Closes-Bug: #1237836
Port server actions unittests to V3 API Part 2

Ports the server actions unittests to test the V3 API.
This mostly involved CamelCase to camel_case changes
and adpating the URLs to point to the V3 API instead of
the V2 API.

It also includes
- Fixing a bug in the admin_password extension picked up by
  the tests where bad request data is not always handled properly
- Generate image ref urls that point to glance api rather than
  the nova api. This fits in with the decision to not port the images
  extension to the V3 API which is implemented here:
  https://review.openstack.org/#/c/40565/
- Moves admin password related tests to the admin password unittests
  test file as this functionality has been moved out from core.

Partially implements blueprint v3-api-unittests

Change-Id: I58b4c0103c824898183fca890c74c3c1cbe19633
Remove xenapi rpm building code

Nova shouldn't be building any types of packages. And if we are we should
be testing this code in gate somewhere.

Change-Id: I70d82a6173b5eda183d4e49d330ae97dd14f9078
Add testr concurrency option for run_tests.sh

By exposing this testr concurrency option, run_tests.sh can now specify
how many processes to run the tests. If not specified, default 0 utilize
maximum CPUs available.

Change-Id: I1a518ae67db32d9838e4a3584cfc3af14212be3c
Uses oslo.imageutils

Commit 035668 had the QemuImgInfo class moved to Oslo.
This class was copied from Nova to Cinder and diverged since then.
The two projects will be able to use identical classes by importing imageutils.

Change-Id: If1962680906b3736d3f16f306b077483b122f878
Ensure migration 209 works with NULL fkey values

Modify the sub-query on migration 209's backup to not select NULL
items which cause the NOT IN to always be false and consequently
the backup not to run resulting in a violation of the foreign keys.

To test, add an instance with NULL uuid to check the backups still
work correctly and avoid violating the foreign key constraint.
If there are NULL values in a NOT IN () set the result is always
false. Therefore having this instance inserted causes migration 209
to fail unless the IN set sub-query is modified appropriately.

Change-Id: Id0f8c8cb082df8861e85f925b979ddd934a95bfc
Closes-Bug: 1240325
Add V3 API sample for admin-password

Adds api sample tests and api samples for admin-password

Partially implements blueprint v3-api-unittests

Change-Id: Iade39ff931471d1d68e358ac5d35a1921e85df66
Validate parameters of agent API

The agent API has some parameters, but they are not validated.
Each parameter is stored to the table "agent_builds", and each column
is defined as varchar(255).

mysql> desc agent_builds;
+--------------+--------------+------+-----+---------+----------------+
| Field        | Type         | Null | Key | Default | Extra          |
+--------------+--------------+------+-----+---------+----------------+
| created_at   | datetime     | YES  |     | NULL    |                |
| updated_at   | datetime     | YES  |     | NULL    |                |
| deleted_at   | datetime     | YES  |     | NULL    |                |
| id           | int(11)      | NO   | PRI | NULL    | auto_increment |
| hypervisor   | varchar(255) | YES  | MUL | NULL    |                |
| os           | varchar(255) | YES  |     | NULL    |                |
| architecture | varchar(255) | YES  |     | NULL    |                |
| version      | varchar(255) | YES  |     | NULL    |                |
| url          | varchar(255) | YES  |     | NULL    |                |
| md5hash      | varchar(255) | YES  |     | NULL    |                |
| deleted      | int(11)      | YES  |     | NULL    |                |
+--------------+--------------+------+-----+---------+----------------+

This patch adds the validation with the type and the length.

Closes-Bug: 1240458

Change-Id: Id06235ebde62f7b96c55b0bd2be5d941bfd2e999
Adding support for multiple hypervisor versions

This is to prevent instances with newer tools from being provisioned
on older hypervisors.
Added comparison of hypervisor version from the compute-node and image
metadata in the image properties filter.
In host scheduler image_prop_filter, the 'hypervisor_version_requires'
image properties, if available, is compared to the host_state's
hypervisor_version, if available.
hypervisor_version_requires should be added on the image as metadata and
should have a operator and version value.
Examples : ">=6.0", ">6.0, <6.2", ""!=6.1"

Partially Implements blueprint xen-support-for-hypervisor-versions
Cell scheduler changes coming up in another commit.
DocImpact

Change-Id: I6fbf232adf9ac78ebb8ac2985739f163f4517d14
Add V2 rpc api for consoleauth

Add support for the 2.0 consoleauth rpc API.  This commit retains
compatibility with the older 1.X API to allow continuous deployment
without any downtime.

UpgradeImpact - Deployments doing continuous deployment should follow
this process to upgrade without any downtime with the consoleauth
service:

    1) Sync all consoleauth services to this commit, so that they handle
       both new and old messages.

    2) Upgrade everything else to this commit so that all clients start
       sending the new messages.

    3) Upgrade past this, where support for the old messages will be
       dropped.

Part of blueprint rpc-major-version-updates-icehouse

Change-Id: Iad71d3c2801f9355968e69bce3308b84f922b239
Adds V3 API samples for console output

Adds api sample tests and api samples for console output

Partially implements blueprint v3-api-unittests
Partially implements blueprint v3-api-specification

Change-Id: I76664a1b0355011c7b42e8571eaf732faed44933
Fix tests for migration 227 to check sqlite

The _check_227 test skips for sqlite despite modifying that dialect.
It also has a redundant check for an existing row that doesn't work
when snake-walking the migration tests.

Change-Id: I58d9a539868d50e345a6dfa78918e04a4a699a68
Closes-Bug: 1240751
Fixes Invalid tag name error when using k:v tagname

This patch fixes the invalid tag name error when k:v type
tagname appears in response of api during xml serialization,
the tagname which contains colon couldn't be supported by
default since it is reserved by xml namespace, this patch
solve it by adding the k of k:v tagname into namespace.

Fixes bug: #1213927

Change-Id: Ib20efb378425cbe5deef45fbac561955cbe0f7bc
Add missing ' to extra_specs debug message

Change-Id: Ia4c54111c0221adadd5a9e049a1f048e46cbc608