Exeption message of 'live migration' is not appropriate

Fix bug 1194367

When do live-migration with RESTAPI body as:
{
    "os-migrateLive": {
        "host": "0443e9a1254044d8b99f35eace132080",
        "block_migration": false
    }
}

Customer would get the following exception:
{
    "badRequest": {
        "message": "host and block_migration must be specified.",
        "code": 400
    }
}

Update the exception to the following which is more accurate:
host, block_migration and disk_over_commit must be specified.

Change-Id: I87fbc8e9d287cd73084ae5e36dd7d6c0bcaec41c
Sane rest API rate limit defaults

The previous rate limit defaults were unusable in any deployment.
Rate limiting to 10 POSTS per minute and 50 servers per day seems
to low, especially when we can use quotas to actually limit the amount
of resources a user can consume.

Update docstring to explain what the rate limiting is used for.

Fixes bug 1178529

DocImpact changed default values

Change-Id: I8cc93423f76d9b0a5135adf69babc4ff355a0951
Add tests for `db.console_pool_*()` functions.

blueprint db-api-tests

Change-Id: I833eaeaa091641c8057f84a0fc73b0c3bfbd54fb
libvirt: Fix spurious backing file existence check.

Bug 1195877

The problem lies with the truncation of backing file names at the
first underscore character. On a reboot, nova-compute checks the
backing images exist. Typically, they will do; however, instead
of looking for an "ephemeral_XXX" file, it hunts for "ephemeral".
This won't exist, triggering code that attempts to pull the whole
image again from glance(!)

Lacking credentials, the attempt to fetch the image will fail,
ultimately resulting in the instance going to an ERROR state.

Change-Id: Iabcc7a1ffd248c22a747a1ddc7863d2b386d409a
Pass instance host-id to Quantum using port bindings extension.

This is a nova change to pass the hostname on which the instance was started to
Quantum. The associated quantum plugins will pass this hostname to
hardware device vendors management stations to allow them to segment the network
in a more precise manner (for example automatically trunk the vlan on the
physical switch port connected to the compute host on which the VM instance was
started).

Implements: blueprint vm-host-quantum

Change-Id: I05012ac7abf67a94b515361a7ef7ac1063cb0ac3
Add unique constraints to Quota.

Added unique constraint 'uniq_quotas0project_id0resource0deleted'
('project_id', 'resource', 'deleted') to Quota model and migrate sripts.
Added new exception `QuotaExists`. Updated quota_create(). Change
quotas duplicates control in create/update code to new DB UC exception.
Tests updated respectively.

blueprint db-enforce-unique-keys

Change-Id: Ia615a1c1a7dc75bd19831fcd0acfc9b78c1b3f6f
Fix resize ordering for COW VHD

When resizing, the snapshot created by snapshot_attached_here
is still required outside of the with block.  This works by coincidence
because XenServer in OS only supports ext3, which does not support
automatic coalescing by default.  This is in the process of being
changed.

Change-Id: I80fa02ea279839921218655cb6de4e88f595a65b
Make flavors is_public option actually work

When you create a flavor, you can set an is_public flag to be True or
False.  It is True by default.  When False, the intention is that the
flavor is only accessible by an admin, unless you use the flavor_access
API extension to grant access to specific tenants.

Unfortunately, the only place in the code where this was being enforced
was when listing flavors through the API.  It would filter out the
non-public ones for a non-admin.  Otherwise, the flavor was accessible.
You could get the details, and you could boot an instance with it, if
you figured out a valid flavor ID.

This patch adds enforcement down in the db layer.  It also fixes one
place in the API where the context wasn't passed down to enable the
enforcement to happen.

Fix bug 1194093.

Change-Id: I5b37fa0bb19683fe1642fd81222547d4a317054e
Merge "Exeption message of 'live migration' is not appropriate"
Merge "Sane rest API rate limit defaults"
Merge "Add tests for `db.console_pool_*()` functions."
Merge "Fix resize ordering for COW VHD"
Merge "libvirt: Fix spurious backing file existence check."
Merge "Add unique constraints to Quota."
Change unique constraint in VirtualInterface.

UC on column address changed to (address, deleted).
Used soft_delete instead of delete.
Migrate scripts updated.
Fix bug 1156227.

blueprint db-enforce-unique-keys

Change-Id: I2f9f92cae3c9e49e0f594437d130c1654f76a343
Add cinder cleanup to migrations.

After deep review actual db state and models i found
few tables in database skipped in db.models.
After moving of cinder in separate project these tables
were not removed.

Tables for deletion:
- sm_flavors
- sm_backend_config
- sm_volume
- virtual_storage_arrays
- volume_metadata
- volume_types
- volume_type_extra_specs
- shadow_sm_flavors
- shadow_sm_backend_config
- shadow_sm_volume
- shadow_virtual_storage_arrays
- shadow_volume_metadata
- shadow_volume_types
- shadow_volume_type_extra_specs

Blueprint: db-sync-models-with-migrations

Change-Id: I67e9f643419b1f43e544837c5e89470d274cd7ae
xenapi: Stub out entry points for BitTorrent tests

This will make the test case play nicer when there is no virtual
environment.

Change-Id: Id7dbea8263295aedc4d9a72cc8a42762307a280b
Merge "Change unique constraint in VirtualInterface."
Make instance show and index use objects

This makes compute_api return instance objects for its
get() and get_all() methods. The necessary changes to
nova-api's compute/servers are included, which are
pretty minor. Most of the change in this patch is making
the tests do the right thing after the switch to objects.

Also, make a mostly-unrelated typo fix in
obj_to_primitive() which was missed in a previous review.

Related to blueprint compute-api-objects

Change-Id: I08dddd311f061e3b39df953b1c8f21f778603770
Make EC2 API request objects instead of converting them.

Now that compute_api can return them, we can simplify
this a bit.

Related to blueprint compute-api-objects

Change-Id: I4c60e913974d8a2d63258d4f63cc988786893089