Return Customer's Quota Usage through Admin API

DocImpact: This patch adds an extension 'UsedLimitsForAdmin'. If this
extention is enabled then it extends the used limits API behavior, such
that admin can fetch the details of any customer's quota usage by passing
the customer's tenant id in query parameters.The API signature for the
same is 'v2/{tenant_id}/limits?tenant_id={customer_tenant_id}'

Change-Id: I89b8b5083e46b899458407426c89a3865e960faa
Implements: blueprint customer-quota-through-admin-api
translates empty remote_ip_prefix to valid cidr for nova

Quantum allows empty remote_ip_prefix to mean "any host"
but Nova uses a CIDR as part of each rule.

Fixes bug 1180828

Change-Id: I4983515ccd0cc621491d63e59d6ab6ac4dd74b6a
add xml api sample tests to os-tenant-network

Change-Id: Ib79defe49c82a175cb8605aa3a65ccd2c48d68f7
Deprecate compute_api_class option in the config

Add a function "get_compute_api_class_name" within nova.compute
that returns nova.compute.cells_api.ComputeCellsAPI if cell is
enabled and this cell is an API cell, and returns compute.api.API
otherwise.
Add an option "cell_type" to the config in group "cells".
Use the default value of "cell_type" (None) for legacy configuration.

Change-Id: I32f5ccf789c657b563c165bfa8244e819b1a79a6
Fixes: bug #1049249
Add missing conversion specifier to ServiceGroupUnavailable

The message in the ServiceGroupUnavailable exception was missing the 's'
conversion specifier.

Fix bug 1183733

Change-Id: I54869431511a72c49ccf61f5e7b1a30607959423
Removing misleading error message

This function (_get_instances_on_driver) was reporting instances are on the
hypervisor and not in the database with no consideration for the filters being
used in the database query. This resulted in error log messages indicating running
instances were not in the database when in fact the query was filtering for deleted
instances.

To avoid misleading error logs of this nature I've removed the logging from the
function. Currently the locations which call this function provide more accurate
logging on the state of the instances that are returned based on the filters they
have called _get_instances_on_driver with.

bug 1183276

Change-Id: I4ee52fe417f73a90cf157bc531b483be93e34275
libvirt: improve the specification of network disks

Allow zero or more hosts, and make the name optional, since only a
host is needed to use nbd. This allows cinder to fully specify the
location of a sheepdog or rbd volume without depending on extra
configuration files, and lays the groundwork for supporting nbd.

Rename the internal attribute source_host to source_name to reflect
its usage in the libvirt xml, and add source_hosts and source_ports
attributes to store the new information.

Fixes: bug 1077817
blueprint better-libvirt-network-volume-support
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>

Change-Id: I8ac431751692e52ba0786768cea996388962922d
Fix msg version type sent to cells RPC API

Regression fix from 6b16c8731c44e4a6c80b803f3e8afdd88386d577, cannot
build instances through cells.

The RPC dispatcher dislikes floats for version numbers.

bug 1190371

Change-Id: I18994ce8a524f88910cfe37c9b302296ce30102f
Fix _drop_unique_constraint_in_sqlite() function.

We got incorrect unique constrains in function
_drop_unique_constraint_in_sqlite().
New function `_get_unique_constraints_in_sqlite()` was added to fix it.

Change-Id: Iebb4c0e6c3e6a069ba5cde2fdb2a2ff1200b826f
Fixes: bug 1184526
Removed session from reservation_create()

Removed session objects from public reservation_create() function
in nova/db/sqlalchemy/api module. Minor code refactoring.

blueprint db-session-cleanup

Change-Id: Ib87dd407328b0208a92a7e50bf4117e85fc512fb
Handle instance directories correctly for migrates.

In Grizzly we changed how we name instance directories. Unfortunately
the decision as to what directory name to use is based on whether
there is a pre-existing directory on the compute node with the old
name.

In the case of live migration, that doesn't work because we have
libvirt copy the directory across for us. So, we need to pass
around the directory name in the migration request. This is better
anyway, as it means that ops types don't need to handle an instance
directory magically renaming itself at some point.

Resolves bug 1175286.

Change-Id: Ib102e644a8742726fa2049303354d466b8109e0b
Fix nova-compute fails to start if quantum is down

When nova-compute starts it needs to check the state of instances that
were previously running and needs to query quantum. Previously, if
it queried quantum and quantum raised an error or was unreachable
nova-compute would terminate. This patch adds a retry loop to prevent
this from happening.

Fixes bug 1186357

Change-Id: I0d865e464f7bf60a0b6dc4ca8a42436d16e29790
Add notes about how doc generation works.

Change-Id: I562c743798aeae5e49bd2f96944c3cacd776a53d
Add yolanda to the mailmap.

Noticed a duplicate entry in the AUTHORS file, added to .mailmap.

Change-Id: I649df9d7273347bec72076dc16a5c2217d1bf1c1
Normalize path for finding api_samples dir

When nova/tests/integrated and doc/api_samples are installed
in different subtrees and are only combined via symlinks,
running test_api_sample fails due to traversing into the
wrong tree. Use path normalization to avoid this problem.

Fixes: LP Bug #1186775

Change-Id: Ibe9e2442dc9bf3ba7bcb429cbac124dcaeea2cef
Fix VMwareVCdriver reporting incorrect stats

fix bug #1180779

VMware nova compute drivers VMwareESXDriver and VMwareVCDriver
currently report stats for the column local_gb in MB instead of in GB
The fix would be to modify vmwareapi/host.py to ensure the values
reported for disk space are calculated in GB instead of MB.
Fix is done by further dividing the existing MB value by 1024 to
convert to GB.
The unit tests to check for capacity and freespace have been modified
to check for GB.

Change-Id: I0610047ee2bddefe0ccb46568c0f48de4c0941af
Silence exceptions from qpid connection.close() (from oslo)

This is commit 15d8d698b7 in oslo-incubator.

Fixes bug 1185465

Don't log exceptions that happen during connection.close().  They're
not surprising (a closed socket can't be read or written), don't
require sysadmin attention, and provide red herrings in the logs
to distract from finding real root causes of problems.

Change-Id: Ia0e25fbc11094b5ad5d6d2cf7d0e786acb3df1f6
hardcode pbr and d2to1 versions

Hard code pbr to d2to1 to >=0.2.10,<0.3 and
pbr to >=0.5,<0.6 for consistency across projects.

Change-Id: I7163bef37934856e5f80df336044f8ebcb690797
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Refactor libvirt driver exception handling

Centralize exception handling for id based instance lookups in new
method _lookup_by_id().

Change-Id: If8d215b85fabf235afcf78a9203378fbb26e68db
Fix quota checks while resizing up by admin

Fixes LP 1184594

Fixing a bug when admin issues a resize up for a user, it checks for
admin's quota instead of user's quota.

Change-Id: Ida5db9039396df0a08c699711b72882e2ef136f8