Catch InstanceNotFound exceptions for V2 API virtual interfaces

Use the common.get_instance method to get the instance object
in the V2 API virtual interfaces extension rather than call
the compute api directly. The utility function
handes InstanceNotFound exceptions and tranlsates them to HTTPNotFound
rather than letting them propagate up causing a traceback.

Co-Authored-By: Michael Still <mikal@stillhq.com>

Change-Id: I8abee22c53195926e3d2af1da9b14cd9d3608e63
Closes-Bug: 1270804
libvirt: raises exception when attempt to resize disk down

Raises an exception when trying to resize an instance that needs to
resize the disk down.

Change-Id: Ic0a0bede744a1aacd057c5db9de3307b61c525b4
Related-Bug: #1270238
VMware: Ensure test VM is running in rescue tests

Code was calling get_info() on test VM, but not using it. There are 2
options to fix this:

1. Use it
2. Don't call get_info()

I have chosen option 1.

This change adds a test on the data returned by get_info() which
ensures that the vm just created is in state power_state.RUNNING. The
code later tests that the vm is in state power_state.SHUTDOWN, so the
additional test that it was previously running reinforces that
rescue() caused the shutdown to happen.

Change-Id: Iec58b0dd40702d3bcebf339e9ada8b90a2229d5c
Fix difference between mysql & psql of flavor-show

If you create a new flavor using a deleted flavorid,
the result of flavor-show is different between mysql and psql.

This issue is caused by the different processing for index in each db.

We need to specify the sort-type to avoid the issue.

Change-Id: Ib1029e80c1b981e1ec86d954b63f83650c9b1cc1
Closes-Bug: #1288636
Libvirt: Repair metadata injection into guests

The change to use Instance objects when spawning instances
changed the format of the 'metadata' property.  But this wasn't
taken into account in the code which actually injects metadata
into /meta.js in the guest's fs.

This patch ensures that the meta.js file injection expects the
new format.

Closes-bug: #1284733

Change-Id: I37049ac01b65d30d588578e351fcddac457f95a7
Merge "VMware: Ensure test VM is running in rescue tests"
Merge "Libvirt: Repair metadata injection into guests"
Merge "Catch InstanceNotFound exceptions for V2 API virtual interfaces"
Merge "libvirt: raises exception when attempt to resize disk down"
Merge "Fix difference between mysql & psql of flavor-show"