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
Dedupe native and EC2 security group APIs.

Reduce the code duplication in the native openstack and EC2 APIs
related to security groups, by factoring commonality into a new
internal SecurityGroupAPI.

Also fixes bug lp 1005931

Change-Id: Ifb92bf5d0f07d5713818a3eee6175ef03e8c0b7c
Add missing ack to impl_qpid.

Fix bug 1012374.

Johannes Erdfelt pointed out that impl_qpid wasn't acking messages that
it received.  This turned out to be a nasty oversight, resulting in
unbounded message queue growth inside of the python-qpid library.  This
fixes it.

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

Fixes bug 1007307.

Change-Id: I0b84d29a86a727b611f60f6be15a6d0d21c17a4b
Re-add private _compute_node_get call to sql api.

Re-adds a private _compute_node_get call to the sql api.
This call is in used by the compute manager.

Fixes LP Bug #1013061.

Change-Id: I28c578509ac70ac7bccede41c3210a46ae56e717
Merge "Dedupe native and EC2 security group APIs."
Ensure dnsmasq accept rules are preset at startup.

Fix bug 1000853.

This bug reported that after restarting nova-network, the dnsmasq ACCEPT
iptables rules were no longer present, causing instances to lose their
IP addresses.  This patch updates the restart_dhcp() function in the
linux_net driver to ensure these rules are present even if dnsmasq was
already running.  Before this was only done when first starting dnsmasq.

Change-Id: Icfbe6177d4c913c3d7755ca40a71752bcdaa4448
Add libvirt min version check.

Fixes LP Bug #1012689.

Change-Id: I91c0b7c41804b2b25026cbe672b9210c305dc29b
Updates the cache

fixes bug 939122

Following are the changes done:
1. in compute/api.py to display the
   floating ip in nova list command upon
   its association with an instance.
2. in network/api.py to solve the similar
   issue upon the floating ip disassocaition
Updated version of: https://review.openstack.org/#/c/7059

Change-Id: Ief1a3f544c3d14bd61cc0814612df3ee521ddec2
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 "Add missing ack to impl_qpid."
Merge "Unwrap httplib.HTTPConnection after WsgiLimiterProxyTest."
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"
Merge "Add libvirt min version check."
Merge "Cleanup instance_update so it only takes a UUID."
Merge "Adds property to selectively enable image caching."