Merge same db calls for some quota methods

db.quota_get_all_by_project is called twice in method limit_check()
and reserve(),
db.quota_get_all_by_project_and_user is called twice in method
get_settable_quotas() in nova/quota.py

Change-Id: Ie5e3a414d3d52964c16613f44fe60a7f68bc0c66
Closes-bug: 1277068
Make os-service API return correct error messages

webob.exc.HTTPBadRequest() can't return the error message
by passing 'detail' parameter.
This patch fixes this bug in nova service_update.

Change-Id: I889d7d1caddd1f0b0dc63292c3ceac7e493b6b79
Make nova-network use FixedIP for host and instance queries

This makes nova-network manager use the FixedIP object for the
get_by_network_and_host() and get_by_instance_uuid() queries.

Related to blueprint nova-network-objects

Change-Id: Ifa26ba1db6a9975e21a5a1c4b8742d82ca6d0772
Make it possible to disable polling for bandwidth usage

Bandwidth usage is only supported by some hypervisor drivers, but
the period task always runs and asks conductor for a list of
instances before it gets a NotImplementedError from the virt driver.

This change allows this to be disabled by setting bandwidth_poll_interval
to 0 which is consistent with other periodic task interval settings,
avoiding the wasted conductor call.

It also will automatically disable bandwidth polling if the driver raises
NotImplemented.

Change-Id: I2ac9c967c5ceafffc39a0a372146c762891a08b8
Fix auto instance unrescue after poll period

We were seeing massive amounts on instance faults from failed automatic
unrescue. It was coming from the instance not having system metadata
populated.

While the route cause is a combination of using non-object instances
that were not populated with system metadata. With an object, the system
metadata would lazyload as required, but clearly not with a pure dict.

This fix ensures the non-object instance has system_metadata, so the
extraction of the flavor from the instance, during notifications sent
during unrescue, now succeed.

Closes-Bug: #1277054
Change-Id: I63bdd6c49505557829241869fd3efd2b2754530b
Break out the meat of the object hydration  process

Since we call the NovaObject base class to hydrate an object, the
subclass implementation does not get a chance to run specific code
during or after hydration. Things like Instance that keep local data for
change tracking need a chance to update themselves after hydration
is complete. This breaks out the meat into a separate method which
can be easily overridden in a subclass.

This also makes Instance use this to ensure metadata tracking is
up-to-date after hydration.

Related to blueprint compute-manager-objects

Change-Id: Ie070c17495f7a4cc6210d256a3170ac9c06e198f
Make delete_instance_metadata() use objects

This adds an optimized Instance.delete_metadata_key() method
and makes compute_api use it instead of calling directly to the
database.

This changes a test that previously verified that the notification
was missing instance.metadata (because of the rpc calling convention)
since we can now include the updated metadata in the notification
easily.

Related to blueprint compute-manager-objects

Change-Id: I827cb98d004e7a612b839dd5a8bbe26cc91c692d
Fix instance metadata tracking during resets

The Instance object tracks its metadata and system_metadata dicts for
changes by maintaining a mirror. This patch fixes the obj_reset_changes()
method which previously would always reset both of those tracking
mirrors anytime any single field was reset.

Change-Id: I496184e3ddaa56b8709f4338fd8cdc2342198273
Removes XML support from security_groups v3 API

The XML namespace was removed from the V3 API plugins,
this part of the code does not work again.

Partially implements blueprint remove-v3-xml-api

Change-Id: Ib30f5f690f8088ed63dd82782698f975024a5b6e
Removes os-simple-tenant-usage from the V3 API

The extension pre-dates ceilometer and equivalent
functionality is now much better managed using
ceilometer. So we're removing this before the V3 API
is officially released.

Partially implements blueprint v3-api-remove-extensions

Change-Id: Ia8fd475e6f0c4dbc67f3c47279cbaa2280b3af0b
Adds tests to sqlachemy.api._retry_on_deadlock

This methods needs tests.

Change-Id: I908daf9e280e25c2ad535bca96b558c19c507e4c
VMware: fix instance rescue bug

Commit I6448cb929e9afce814d0580eada91b8fd37befa3 added object support
to the rescue operations. This exposed a bug in the VMware driver
which was caught by the minesweeper. A rescue instance is named
'<instance-uuid>-rescue'. In the past this name was updated on the
instance, now it is passed as a parameter to the spawn method.

Change-Id: I633614c6c634d41a32a9b1b70d941e9bfdcadedd
Closes-bug: #1278149
Docker cannot start a new instance because of an internal error

The root cause for the issue is that the Docker rest API does not
longer deliver the container list for v1.4 api calls.
The Docker API must be upgraded to 1.7.

Docker API 1.7 is a good choice since that is the first docker version
which officially supports rhel/centos.

In addition will docker client only parse json if the response needed
(to_json()) and this method will not catch json parse exception which makes
finding th eroot cause of a problem in the future easier.

Change-Id: I53dfac5f09ee021c6ed4763f7f164206e8ab32ff
Closes-Bug: #1278104
Renumber some nova hacking checks

Most of the nova hacking checks had picked numbers starting
from approx N300 onwards. Two recent additions randomly
picked N123 and N500. Renumber these to N313 and N314 and
make sure they're documented in HACKING.rst. Mention the
guidelines in the hacking source file for benefit of
future authors

Change-Id: Ia3eb4cb9a4ac7409db7eba9e1689f4a5780b8795
Merge "VMware: fix instance rescue bug"
Merge "Adds tests to sqlachemy.api._retry_on_deadlock"
Merge "Fix auto instance unrescue after poll period"
Merge "Renumber some nova hacking checks"
Merge "Make nova-network use FixedIP for host and instance queries"
Merge "Docker cannot start a new instance because of an internal error"