separate Metadata logic away from the web service

The changes here are coming as a result of starting on blueprint
config-drive-v2 [1].  I wanted to separate out the "Metadata" from the
"Metadata Server".  Thus, the creation of nova/api/metadata/base.py.

The InstanceMetadata in base.py contains most of the logic for
presenting metadata.  As a result, the Metadata webservice in handler.py
greatly simplified.  This should make it easier to render duplicate
data to a config drive.

Additional changes here:
 * a few more tests
 * removal of the separate 'Versions' handler.  Its now replaced
   by the single handler.

Change-Id: I35fcfd8d7f247763954afc0a9f752f629b243e9b
Adds property to selectively enable image caching.

The image-property `cache_in_nova` can be used to choose which images
should be cached in Nova. One use-case would be to cache base images but
not any customer snapshots.

Change-Id: I1b8ac914a6effd4cd4653aae7e4eac9d14d0e7bd
Revert "Fix nova-manage backend_add with sr_uuid"

Fixes bug 988596

Change 77495cfe breaks storage manager, as it makes a
wrong assumption about nova-manage. The sr-uuid must be
generated and provided by the xenapi storage manager.

When the volume service is started, SM volume driver will
create a new SR for everything that does not have an
existing sr_uuid and will populate the db with the result.
It will only introduce the SRs that do have one. The introduce
will work only if the uuid provided is something SM understands.

This partially reverts commit 77495cfed17f12f225e11fbc10e0f8db516dadf2.
Changes in db are left intact.

Change-Id: I8405ac905a15f829f704951b94297f3b6f6c0a29
Unwrap httplib.HTTPConnection after WsgiLimiterProxyTest.

Fixes bug 1007307.

Change-Id: I0b84d29a86a727b611f60f6be15a6d0d21c17a4b
bug #996880 change HostNotFound in hosts to HTTPNotFound

Change-Id: Ib8b7f1f26c2370e2a82b491d8774797985c0ae98
Add libvirt min version check.

Fixes LP Bug #1012689.

Change-Id: I91c0b7c41804b2b25026cbe672b9210c305dc29b
Cleanup instance_update so it only takes a UUID.

You know when you try to do something simple like tweak
instance_update and instance_update_and_get_original and
it turns out to have all these knock on effects? Yeah,
that.

I still think this is a good idea though. I'd like to live
in a future where we don't have instance ids at all at the
DB API level. We need to do this to get there.

Change-Id: Ia51d06beaec068a8544642a6a4bf489247ff61a0
Merge "Unwrap httplib.HTTPConnection after WsgiLimiterProxyTest."
xensm: Fix xensm volume driver after uuid changes

Fixes Bug 1013436
Minor fixes after uuid in volumes were changed from
integers.
The parameters passed to create_vdi have changed, so
modify the call from SM code accordingly

Change-Id: I3d61f0221b23bba9a9e218209d5293be8960e2e2
Present correct ec2id format for volumes and snaps

Fixes bug 1013765
* Add template argument to ec2utils.id_to_ec2_id() calls

Change-Id: I5e574f8e60d091ef8862ad814e2c8ab993daa366
Merge "Revert "Fix nova-manage backend_add with sr_uuid""
Merge "separate Metadata logic away from the web service"
Add CPU arch filter scheduler support

In a mixed environment of running different CPU architecutres,
one would not want to run an ARM instance on a X86_64 host and
vice versa.

This scheduler filter option will prevent instances running
on a host that it is not intended for.

The libvirt driver queries the guest capabilities of the
host and stores the guest arches in the permitted_instances_types
list in the cpu_info dict of the host.

The Xen equivalent will be done later in another commit.

The arch filter will compare the instance arch against
the permitted_instances_types of a host
and filter out invalid hosts.

Also adds ARM as a valid arch to the filter.

The ArchFilter is not turned on by default.

Change-Id: I17bd103f00c25d6006a421252c9c8dcfd2d2c49b
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "Add libvirt min version check."
Merge "Cleanup instance_update so it only takes a UUID."
Merge "Adds property to selectively enable image caching."
Merge "Present correct ec2id format for volumes and snaps"
Replaces functions in utils.py with openstack/common/timeutils.py

Fixes bug #1008628

1. Edit openstack-common.conf and import nova/openstack/common/timeutils.py
2. Move time related functions from utils.py to timeutils.py
3. Replace following functions in utils.py with timeutils.py
- isotime
- parse_isotime
- strtime
- parse_strtime
- normalize_time
- is_older_than
- utcnow_ts
- utcnow
- set_time_override
- advance_time_delta
- advance_time_seconds
- clear_time_override
4. Remove datetime related functions and datetime related unittests

Change-Id: I9a92be286fb071b6237dd39495d88dae106e2ce0
Enforce an instance uuid for instance_test_and_set.

This method only has one caller (compute/api.py) and it turns out
was already always getting a uuid, so this is a relatively minor
change.

Change-Id: I5beae5a707be053903f40cc98ed43b66eaf945a9
added deprecated.warn helper method

provide a convenience method for indicating in code that a config
option the operateor will have to deal with exists in their environment.

Change-Id: I17b0c120d54b1db75c6bb29d107e4a15a5202e76