Add CRUD methods for tags to the EC2 API.

This is an incomplete implementation of the EC2 tags API.  In EC2, most
resources are able to be tagged.  See
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html

In openstack, the only currently 'taggable' resource is an instance, as
it has an instance_metadata table associated.  So far, only instance
tagging has been implemented, but it is relatively simple to extend this
to other resource types by creating the associated model and api calls.

Additionally, in EC2 searches, shell-style globs are allowed, eg:
fo* will match fo, foo, foobar
fo? will match foo

This has been left to do at a later date.

DocImpact: Adds new API calls: CreateTags, DeleteTags, DescribeTags
See:
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateTags.html
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteTags.html
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeTags.html

Fixes: bug #1096821
Implements: blueprint ec2-tags-api

Change-Id: Idf1108f6a3476cabdbdb32ff41c00aa4bc2d9ffe
Signed-off-by: Stephen Gran <stephen.gran@guardian.co.uk>
libvirt: Get driver type from base image type.

If we are using the raw backend (no cow), we should set the driver
type based on the type of the source image instead of always
using raw.

Calls to to_xml were moved after _create_image so that the image
type could be determined when creating the xml for libvirt.

Fixes bug 1163009

Change-Id: Ic8d5f0ab83d868a42f834d39c0afb64818d7e027
Modify _verify_response to validate response codes.

The method will now take a response code as an additional
parameter and will validate it against the actual one.
Fixes bug 1156684

Change-Id: Idba3f54ed50b359d9230707fb45e7c5ea68e6b7d
Fix SecurityGroups XML sample tests

Fixes bug 1157521

Change-Id: I38ad52e0720feea37e8dbda8ad9c29162842c8f1
Resolve conflicting mac address in resize

This patch fixes bug 1161226 and mac address conflicts when migrating or
resizing an instance using the PowerVM driver. This will ensure that if
a migration or resize is taking place on the same host, a temporary mac
address will be assigned to the original LPAR so there is no conflict on
the VIOS when a second LPAR is started with the same address.

Change-Id: I59db484defb789f3a7c0eddbd5ef9e92efc22419
Fallback to conductor if types are not stashed.

If the instance types are not stashed, fallback to
the conductor API to retrieve them.

bug 1164110

Change-Id: I1f0ef48e072f8580980de5bd8d43cf2206cd7d27
Remove deprecated Grizzly code.

Now that Havana development has started remove code deprecated in Grizzly.

Change-Id: Ie3e7611347c334c359dea98d759345b97c66c9c1
Move console scripts to entrypoints.

As part of the move of plugins to entrypoints, take advantage of the
entrypoints based console scripts, which will make our command line scripts
available for unittesting.

Part of blueprint entrypoints-plugins

Co-authored-by: Michael Still <mikal@stillhq.com>

Change-Id: I5f17348b7b3cc896c92263dd518abb128757d81f
baremetal: Integrate provisioning and non-provisioning interfaces

Originally, baremetal pxe/tilera driver managed two types of network
interfaces in two tables; provisioning interfaces in bm_nodes table
and non-provisioning (normal) interfaces in bm_interfaces table.
But, now actually both types are handled in the same way and there is
no difference between them except for which table they are in.

This patch moves the provisioning interfaces to bm_interfaces. However
it does not drop prov_mac_address in bm_nodes since VirtualPowerManager
still uses it to identify a target in a list of VMs returned by the
VM's host.

Change-Id: I5ce940e7127aa3b29ba7802612938dc5dbc3152f
Merge "Fallback to conductor if types are not stashed."
Merge "Remove deprecated Grizzly code."
Optimize resource tracker queries for instances

instance_get_all_by_host_and_node() had 4 different joins being done.
The resource tracker is the only consumer of this method and does not
need the joins.  This optimization will save many unnecessary rows from
being fetched during the update_available_resource() audit task.

Change-Id: I414c219e4563634e270007fe3d0fa980b273e795
Merge "Optimize resource tracker queries for instances"
Merge "Move console scripts to entrypoints."
Merge "Add CRUD methods for tags to the EC2 API."
Merge "Modify _verify_response to validate response codes."
Merge "Fix SecurityGroups XML sample tests"
Merge "Resolve conflicting mac address in resize"
Remove race condition (in InstanceTypeProjects)

Soft delete all duplicate rows with the same (project_id, instance_type_id)
except one with the biggest value in `id` column.

Create UC on columns (project_id, instance_type_id, deleted)

Add tests for migration

Fix instance_type_access_add method
	Replace Select then Insert -> Try to Insert.

blueprint db-enforce-unique-keys

Change-Id: Id70509337e78f3bf778501f2c77aa03263580ef0
Add missing tests for instance_type_extra_specs_* methods

There was no tests in test_db_api for instance_type_extra_specs_*
methods.

Add tests to ensure that all works.

blueprint db-api-tests

Change-Id: Ie88aa776574c5ddf37a1adcf7cc2c9e70c6eb810