do sync before fusermount to avoid busyness

Fix bug #1013689

Change-Id: I8ae786e105c08e1b5011a1b2a1dac048a710a1cb
metadata: cleanup pubkey representation

The previous code provided a '_name' entry in a dict to represent
this, but then appended "=_name" to the key rather than populating
_name with the full value to be rendered.

This just changes the value in '_name' for public key to be
'0=keyname' rather than 'keyname'.  It makes the rendering simpler by
just using the
_name.

It also adds a test for this strange behavior of the metadata service.

Change-Id: I3ef67d85354bf7ac8abaaf900ddfdd2e945aa9af
Re-factor instance DB creation

This patch speeds up the DB creation process considerably in deployments
with a considerable amount of instances.  It also cleans up a lot of the
code which ends up creating the instance DB record.

The biggest improvement in this patch is removing unnecessary joins in
security_groups DB calls.  This also reduces the number of DB calls
needed to create an instance DB record in general.

Side effect of this patch is the default 'display_name' for an instance
when it (or hostname) is not specified is now 'Server <uuid>' vs
'Server <id>'.  Because of the use of 'id', it required creating the DB
record, then updating the record later after we new the 'id'.  This is
gone.

Fixes bug 1017722

Change-Id: I9b7d48644a7abe075545c2c11399351b6a37939c
Remove unnecessary queries for network info in notifications

bandwidth_usage() tries to query network info if "not network_info"
when looking at instance['info_cache'].  [] is a valid entry for
network_info (on build)... so don't query network when we see it.

Fixes bug 1017770

Change-Id: Ia7291dbbcc25c04eff16eb048068f879e18f53a4
Improve filter_scheduler performance

Add 'columns_to_join' keyword arg to instance_get_all() and have the
scheduler host_manager only join 'instance_type'.  It doesn't use
anything else.

Fixes bug 1017769

Change-Id: Ia2c0956d2453f00e26eb89d9496a32ba15d970aa
Fix db calls for snaphsot and volume mapping

 * Fix misuse of project_only
 * Includes failing tests
 * Adds missing call to db/api.py
 * Fixes bug 1017816

Change-Id: I993089ba031a05e7ab0ea91c279a2ac47593eda3
Avoid reset on hard reboot if not supported.

Updates the libvirt connection so that it avoids using virt_dom.reset(0)
when performing a hard reboot if it is not supported.

Libvirt reset requires at least libvirt 0.9.7.

When reset is not supported it uses the older method of recreating the
domain.

This patch also sets the libvirt min version back to 0.9.6.

Fixes LP Bug #1017593.

Change-Id: I6c46c03fad9de11ae3cc814b06dd8e13bb66de2d
Remove extra DB calls for instances from OS API extensions

Allow the core API to store DB results so that extensions can use data
already retrieved within the same API request...eliminating extra
expensive DB calls.  This implements storing of instances only, so far.

Fixes bug 1017756

Change-Id: I98a2e3323f5ea69ab9e7470f95d821790510989e
Stop nova_ipam_lib from changing the timeout setting

 * Fixes incorrect logic for when timeout should be used. We
   want to timeout along with dhcp, and release immediately
   without dhcp
 * Also makes ipam_lib release fixed_ips after floating ips, as
   this is the way that the internal network managers do it.
 * Fixes bug 1014769

Change-Id: I687fac314264b8a89da128ed77c02d9b1ca140ff
Adds missing 'owner' attribute to image.

Fixes bug 1018216.

Change-Id: I5540e0b8ab1df1904778e3edc250369b0930987e
Merge "Re-factor instance DB creation"
Merge "Remove extra DB calls for instances from OS API extensions"
Merge "Remove unnecessary queries for network info in notifications"
Merge "Improve filter_scheduler performance"
Merge "do sync before fusermount to avoid busyness"
Merge "metadata: cleanup pubkey representation"
Merge "Adds missing 'owner' attribute to image."
Merge "Avoid reset on hard reboot if not supported."
refactor libvirt from connection -> driver

part of bp:virt-driver-cleanup

part d) of the blueprint is to get rid of the connection terminology
and use driver instead. This does this for the libvirt driver and
associated tests.

Also add LibvirtDriver import to __init__ so that
nova.virt.libvirt.LibvirtDriver can be used as the compute_driver
string

Change-Id: I13c701c390784fa1f7809705741abb46e40973be
Merge "Stop nova_ipam_lib from changing the timeout setting"