Allow retrying network allocations separately

Introduce a new config option, 'network_allocate_retries', that allows
one to retry network allocations.  The default is 0 for no retries to
match the current behavior.

The network allocations currently get retried by a full retry of a build
via the scheduler, if those are enabled.  This patch reduces the need to
re-schedule for simple network allocation issues.

The retrying happens in the network alloc async greenthread, so for virt
drivers that support the new NetworkModel, the retrying potentially
happens in the background while the image is being downloaded, etc.

DocImpact

Change-Id: I1a5fdcccbb736fc0b1d8c0cbc3b45a8372a6aef7
Report the az based on the value in the instance table.

When attempting to find the availability zone of an instance
do so by first trying to locate the availability zone of the
host the instance is active on. If that fails then attempt
to use the value that is in the instances 'availability_zone'
key instead.

For the caching used in the availability_zones module there
was a new method added to get and reset the cache that is
useful for unit tests, since during each run of a test you
do not want to be affected by something in cache from a previous
test.

Fixes bug 1172246

Change-Id: I6f54a44cc87434120656ccc789cebcc08d434418
Merge "Change resource links when url has no project id"
Merge "Port flavors core API to v3 tree"
Merge "Prepare fake instance stubs for objects"
Merge "Make fake_network tolerant of objects"
Merge "Imported Translations from Transifex"
Merge "Cells: Add support for global cinder"
Remove broken config_drive image_href support.

image_href support has not been working since at least shortly before
Folsom release.  This is a good indication that this functionality is not
used.  As far as I can tell, the docs also do not match what was
supported.  An image ID was required, but docs show examples with full
hrefs.

DocImpact

http://docs.openstack.org/developer/nova/api_ext/ext_config_drive.html

References to supporting image_hrefs should be removed.

This patch also removes the hack that passed a config_drive_id via
the Instance dictionary when config_drive_id is not a valid Column for
Instance.

Fixes bug 1186401

Change-Id: Iced7bc8e278cb9f208183f1dbb7a293675a47eae
Make sure periodic instance reclaims continues on error

If an instance reclaim operation fails with an exception, no more
instances will be reclaimed. If the failure is permanent, this will
block other instances from being reclaimed for as long as it remains.

Resolves bug 1195029.

Change-Id: I0379d16a1f74344ef44c843ce19a505e31e79bfa
Merge "Retry quota_reserve on DBDeadlock"
Merge "Cells: Pass object for start/stop"
Merge "Port quota classes extension to v3 API Part 1"
Merge "Adds support for the Indigo Virtual Switch (IVS)"
Merge "Accept is_public=None when listing all flavors"
Add obj_to_primitive() to recursively primitiveize objects

Occasionally we need to recursively process a NovaObject into a
representative dict or list. This patch adds a function to do that
recursively, accounting for nested objects and lists of objects.

Related to blueprint unified-object-model

Change-Id: I6adb84f9e5a0564ec4af14200e26e838b4a5bb6e
Add update() method to NovaObject for dict compatibility

In order for objects to behave like dicts, they need to
support the update() method. This patch adds that.

Related to blueprint unified-object-model

Change-Id: Icb3932682285cbf8e7362e5b748e42a754b17fe7
xenapi: Remove vestigial `compile_metrics` code

`compile_metrics` is no longer called as it was superceded by:

    https://github.com/openstack/nova/commit/8887f10c66bca248f289db8f834ae8f36f9a03a1

Fixes bug 1194990

Change-Id: Ia651ac69fc38ed3f5cb29562556f7065caba225a
Port Simple_tenant_usage API to v3 Part 2

This patch contains the changes required to adapt the Simple_tenant_usage
extension and the corresponding unittest to the v3 framework

Partially implements: bp v3-api-extension-versioning

Change-Id: I2db66704a77e822543e270773acc847267ef6ece
Port server password extension to v3 API Part 1

This changeset only copies the v2 implementation file into the
appropriate v3 directory unchanged. The copy as-is will not be
loaded by either the v2 or v3 extension loaders. The second
changeset will then make the changes required for it to work as a
v3 extension.

This is being done in order to make reviewing of extension porting
easier as gerrit will display only what is actually changed for v3
rather than entirely new files

Partially implements blueprint nova-v3-api

Change-Id: I8be578ed4fada25ec4a8aa8adb3addb0a3791f85