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
IPMI driver sets bootdev option persistently.

This patch changes baremetal ipmi driver's behavior with regards to
setting the chassis boot device.

Previous behavior: set bootdev = pxe for next boot only.
New behavior: set bootdev = pxe persistently.

Fixes bug 1178092

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

Change-Id: Ib79defe49c82a175cb8605aa3a65ccd2c48d68f7
Moved sample network creation out of unittest base class constructor.

This sample networks only needed in:

 nova.tests.api.ec2.test_cloud
 nova.tests.integrated.test_api_samples
 nova.tests.network.test_manager
 nova.tests.test_libvirt
 nova.tests.test_xenapi

Moreover, base class constructor is not good place for sample
data creation. Database should be empty before runing tests.

Fixes: bug 1181502

Change-Id: I8dcaa5b36a1da0c0928c9445c556d788d463844e
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
In utils.tempdir, pass CONF.tempdir as an argument.

It's ugly, and potentially racy, to mess around with other modules'
global variables.  Instead, pass CONF.tempdir into tempfile.mkdtemp
as the 'dir' keyword argument.

Because we already pass **kwargs to mkdtemp, inspect **kwargs and
only set 'dir' if it's not already there.

Change-Id: I8a2b34cd051919db29facabc1664cf357073b1d7
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 EC2 RegisterImage ImageLocation starts with /

* Allows image location that begins with '/' during EC2 image register
* Adds relevant unit test

Fixes LP bug #1074908

Change-Id: I488b126c2079de4370823b347e80c7ec1ecc2c9f
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
Enhance multipath parsing

The output of the multipath command is not always parseable from
the current implementation. This causes attach to fail.

Fixes Bug: #1184861

Change-Id: I1afa96a695b1008672226e7e76eb8e0feca52578
_s3_create handles image being deleted

Change so _s3_create handles the image it is creating
being deleted while it is creating it without logging a stacktrace
and instead just logging a simple message explaining what happened.

Fixes bug 1084703

Change-Id: I9d984dd1cf4f393010493cacd048d20ad5225db8
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
Cosmetic fix to parameter name in DB API

service_destroy() was using instance_id instead of service_id.

Change-Id: Id1a839b16f4513d91b7014b082637a644346b664
Fix bug where consoleauth depended on remote conductor service

Fixes bug 1186123

Conductor API was being imported directly so ignoring use_local FLAG

Change-Id: I055a5301d4c18d201d67f114047f503114751603
Launch_at and terminated_at on server(s) response

Implements bp usage-details-on-instance

Change-Id: I0a9101c43a51d597a1eaff9d5a5d08d602024e72
Remove unused launch_time from instance

'launch_time' is passed around as part of instance properties when an
instance is being built, however it is not a column in the DB nor is it
even used anywhere.

It was also unnecessarily copied around in various tests.

This patch removes all references to it.

Change-Id: I2300cd6b8539d15bbcd35ab4c00ab99d4be13eb5