Organize limits units and per-units constants

During v3 api review there was an agreement that would be nice to move limits
constants to utils file and refactor its usage inside limits api to avoid
unnecessary code duplication.

Also changed TestLimiter class to MockLimiter since that name can be confuse to
some unit test frameworks.

Change-Id: I1b8626e8d1e3257333d4dfee61591fd4cde82bd1
Log xml in libvirt _create_domain failures

When an error occurs defining, launching or enabling hairpin mode on a
libvirt domain, log the xml for reproduction and analysis.

Fixes bug 1183534

Change-Id: Ic8f1d11c5a92779c686b7248895bbc6f2cfdbf0b
Check the instance ID before creating it

At least with libvirt 1.x instance goes into shutdown state
before its ID is changed. This means that there's a race
condition during reboot where nova might try to create an
instance that's already defined. By checking if the ID of
the new and old instance is the same, we avoid that situation
and reiterate on the loop.

The tests for this are added in
I6215f80bd15820dac80151e7063916dbbc21d761

Change-Id: I493b828f0c6848fbadc591be2f47fd1b12fd3a51
Fixes: bug 1181924
Add tests for libvirt's reboot functionality

This patcha adds the missing tests for libvirt drivers reboot method.

Change-Id: I6215f80bd15820dac80151e7063916dbbc21d761
No support for double nested 64 bit guest using VCDriver

64bit instances launched on ESX via the VCDriver will not
support running 64bit guests. There is an option that can
be passed during the vmx creation that will allow for this
to happen. This is very useful if you want to run hypervisors
 (esx, kvm) on top of ESX and then run 64bit VMs on top of
those hypervisors.

Fixes bug 1192256

Change-Id: Id6eb224c97569737cbb41f1b64f61805e1df004e
Sync db.models.Quota* with migrations.

Blueprint: db-sync-models-with-migrations

Change-Id: Ic97690b650151eb7086cbd40093c0f3c373133e2
Baremetal_deploy_helper error message formatting.

Updates our baremetal_deploy_helper so our error message use
formatting that works with translations.

Change-Id: I8811df50f0e80c5680e6316c829a197b0ade5967
Stop creating folders in virt unit tests

Before nova.tests.virt.libvirt tests created 4 empty UUID named folders
in the top level nova directory.  Tests should not leave artifacts like
these around.

Fix bug 1194676

Change-Id: I941b23ecb94db2f4a0cc60eeb06766f960775ba1
xenapi: Improve cross-device linking error message.

Catch invalid-cross device linking exceptions raise from os.rename
and provide a more intelligible error message.

Change-Id: I22b6a145141431b6d4e4cb0176881f0cf0dd609f
xenapi: Make BitTorrent url more flexible

Change xenapi bittorrent plugin to not assume that torrent file
is under CONF.xenapi_torrent_base_url + image_id + ".torrent".

This allows for sources images from arbitrary torrent URLs.

Change-Id: Ica9462a51c6299b5affc861781f3054d18866458
Fix a couple typos in the nova.exception module

This patch fixes a couple of typos in localized user-facing strings in
the nova.exception module.

Fixes bug 1194944

Change-Id: Ia85e69c23832ab4fd9f56c525075bd30bf4b059e
Better default for my_ip if 8.8.8.8 is unreachable

Run if route/show, extract ipv4 addresses and pick the first one.
Fall back to 127.0.0.1 as before if we don't find anything
or if we have running the ip route/show commands

Fixes LP# 1193013

Change-Id: If73f0f6bf67f858f7506220debab0f74cc9e3cb4
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
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
Port flavor_access extension to v3 API Part 1

This changeset only copies the v2 files (implementation and test)
into the appropriate v3 directories 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: I6a2648ac9f59ff122f06a63991b57e595b2c5696
Port flavor_access extension to v3 API Part 2

Ports the flavor_access extension and the corresponding
unittests to the v3 framework.

Partially implements blueprint nova-v3-api

Change-Id: I671f490bad2daaaae06d48328f4fff10076ab0ed
Merge "Stop creating folders in virt unit tests"
Merge "Add obj_to_primitive() to recursively primitiveize objects"
Merge "Add update() method to NovaObject for dict compatibility"