Sync db.models.Instance* with migrations.

This patch syncs models with migrations for:
    - InstanceIdMapping
    - InstanceMetadata
    - InstanceSystemMetadata
    - InstanceTypeExtraSpecs
    - InstanceTypeProjects
    - InstanceTypes
    - InstanceGroupMember
    - InstanceGroupPolicy
    - InstanceGroupMetadata

Blueprint: db-sync-models-with-migrations

Change-Id: Ice28b9d545f60f7df381e3fcf2c86a2b8e7350d3
Sync db.models.Security* and db.models.Volume*.

This patch syncs models with migrations.

Change-Id: I2e4a4cf28376d933be47bc496933e6964e19a56e
Clarify flavorid vs instance_type_id in db

And add comment about future direction.

Partially implements bp flavor-instance-type-dedup

Change-Id: Ia6c1bad5c3cc35e772c32803c27a50a7728045e5
Sync 10 DB models and migrations.

This patch syncs models with migrations for:
- BlockDeviceMapping
- IscsiTarget
- FixedIp
- FloatingIp
- KeyPair
- Migration
- Network
- ProviderFirewallRule
- Reservation
- S3Image

Blueprint: db-sync-models-with-migrations

Change-Id: I8e16375fe48744513167272e956cdbfdbfd8af23
Change force_dhcp_release default to True

Historically it was was false because it requires the dnsmasq binary
'dhcp_release' which was not present in all distros.

Related to bug 970893

DocImpact

Change-Id: I4975d85a66fb930d6a56900dd569cec2a1874439
Moved tests for server._action_rebuild

Move tests to separate class as a preparation for code
deduplication.

This work continues in https://review.openstack.org/34556

bp nova-tests-code-duplication

Change-Id: I985232fa0a9b2d5b73034047b06138a8a3d7e390
Code dedup in tests for server._action_rebuild

Externed common parts to setUp():
- request body
- request object
- test image UUID
- test image URL
These parts were equal in the most part of the methods.

bp nova-tests-code-duplication

Change-Id: Ie29dd090075915a4065ee395b4e50fc178f72f3b
Code dedup in class ServersControllerCreateTest

Externed common parts to setUp():
- request body
- request object
- test image UUID
- test flavor URL
These parts were equal in the most part of the methods.

bp nova-tests-code-duplication

Change-Id: I091f14a9753059d759ba2f7b05ff33f5abea0f00
Make ServersViewBuilderTest DRYer.

Move detail and brief info about server from test methods to setUp()
to expected_detailed_server and expected_server respectively. Every
test modifies the particular fields in the variables to create
appropriate test environment.

Blueprint: nova-tests-code-duplication
Change-Id: I31bf6ed3c266da99c57b128c298cf7beae9a6db4
Code dedup in test_libvirt_volume

- externed common assertions to methods
- externed common parts to setUp():
  - test disk info
  - test connector
  - test volume name, location, iqn, data, uuid
  - test user
  - test fake connection

bp nova-tests-code-duplication

Change-Id: I83bfd8b597121c9de091283845b841680e150e76
Code dedup in class ImageXMLSerializationTest

Externed common parts to setUp():
- fixture with test image data
- test image
- dictionary with test images
- test serializer
These parts were equal in the most part of the methods.

bp nova-tests-code-duplication

Change-Id: I8394c7ccbd0d71ffcf5f35c64a5c307dbf579364
Fix mig 186 downgrade when using sqlalchemy >= 0.8

This patch fixes an issue that cause tests to break when using
SQLAlchemy 0.8 and newer. The migration was using non-existing column
names in an update query. Referring to a non-existent column in an
insert() or update() construct will raise an error instead of a warning
in SQLAlchemy 0.8.

As an added bonus - this patch adds the downgrade tests for migration
186 (which were missed in the original patch) to ensure there are no
further regressions.

Fixes bug: #1201453

Change-Id: I3c679e95583ee0c1bded5a01ddec6d6212904195
Add expected_errors for extension deferred_delete v3

Partially implements bp v3-api-extension-versioning

Change-Id: Ia63f6cd947c20a05e84385f2401d6b869ebeb456
Add validation of available_zone during instance create

When using nova boot command with --availability_zone parameter and only
input the zone without host and node, now will check if the zone is
available, if not, then return an error message directly rather than
create an instance with an Error state

Add a get_only_available option to function get_availability_zones

To disable available zone, one should have to disable both the scheduler
filter and the API extension, if the API extension is not disabled, this
patch will still do the validation of available zone

DocImpact

Change-Id: Ibff117d48b60ac4f4ae33e3b3d2840d7313ce0d4
Fixes wrong action comment 'lock' to 'unlock'

Change-Id: I2f285b405b598d69f80504b040b4a0e32d80020b
Remove project_id from alternate image link path

Removes the project id from the alternate link path
generated for the v3 API os-images extension.

Also fixes issue with os.path.join being used to generate
urls which will break on Windows.

Partially implements blueprint nova-v3-api

Change-Id: Icc34359cc935920e2d4780849d9310c4961c8f74
Add missing tests for console_* methods.

There was no tests in test_db_api for console_* methods.
Add tests to ensure that all works.

blueprint db-api-tests

Change-Id: Ic3d5a3dd60ba50b561126279c00ca07022aaa20e
Missed message -> msg_fmt conversion

We recently changed NovaException's to define `msg_fmt` instead of `message`
on the class. Looks like this exception was missed for some reason.

Fixes bug 1202255

Change-Id: If828bf42fa077665d1d92e08758fbddd342ab626
ec2-api: Disable describing of instances using deleted tags as filter.

Previously, one could describe instances using a deleted tag filter
that was once associated to the instance. The current change disables
describing instances via a deleted tag. Also,minor refactor in the
same function.

fixes bug #1197242

Change-Id: Iac6aa85b69d5a6dc563c00f3497cdab08e178ec1
Fix inconsistency between Nova-Net and Neutron

The neutron client raises NeutronClientException (status_code 404)
that is not unknown for nova, and is translated in 500 computeFault.
Catching this exception in nova/nova/network/neutronv2/api.py and
raising more generic exception as exception.NotFound solves the problem.

Added also an unitary test to test neutronv2 api

bug #1160309
bug #1200175

Change-Id: Ib2f1a0d49a12114b28f0cd5ce0bb7119f864d1a6