Fix api direct use of instance module objects

This switches the nova/api and nova/tests/api code to use
nova.objects.Instance* vs nova.objects.instance.Instance*.

Partial-Blueprint: object-subclassing

Change-Id: I146f1d082fa37e1a5c09aa8c5363746daffbc219
Revert "Allow admin user to get all tenant's floating IPs"

This reverts commit 6478554f531f6ee2fa86226fbc79dd31e556bc06.

This API change merged as a bug fix and introduced bugs and our API
change policy is more or less to go through the blueprint/nova-specs
review process:

http://lists.openstack.org/pipermail/openstack-dev/2014-June/037536.html

So reverting this so it can go through the blueprint/nova-specs
review process.

There should be minimal impacts to removing this (broken) API since
it merged not too long ago and was added strictly for Ceilometer's
usage, not an external deployer that would be (more) broken by this
API removal.

Closes-Bug: #1328694

Change-Id: I22a711795ea616aabc155a71703c9c794e84a5dc
Save connection info in libvirt after volume connect

The libvirt driver will connect volumes for BFV while processing
the guest configuration, but not save the connection_info into
the database. This adds a save there to make sure that any
storage driver details get persisted.

Change-Id: Ia99e04ad80a2823a6852debf0919e72b2f93bd26
Related-bug: #1328245
Failure during termination should always leave state as error()

Currently we have a situation where if an instance fails to delete,
instead of having its state reverted, like we do in most places we set
it to error,deleting. This was intentionally done in
I5fb1bbd56035792f566a6e076edfe7a69df006ef. We also intentionally ignore
duplicate requests to delete an instance if its already being deleted
(I2f97f93bd714e0ea3b6d4fa3ac457ab43eed00e1). The combination of these two
things means that if an instance fails to delete for some reason a
tenant is unable to delete that instance.

It turns out this is really bad because instances in deleting state
count against quota, so the tenant slowly looses usable quota.

To fix this, upon a failed termination set the vm_state to error and
revert the task_state. This is a partial revert of
I55742203bdd071c7df90902868e46c2020f799bd.

Change-Id: I55742203bdd071c7df90902868e46c2020f799bd
Closes-Bug: #1329559
Skip migrations test_walk_versions instead of pass

When there is no db engine configured for the migration tests,
the test_walk_versions test was passing, rather than skipping,
because it contained a for-loop and no check for the length of the
sequence being iterated over.
This patch checks the length of the configured engines and
properly skips the test when there are no engines.

Change-Id: I4078655f01638c22cf029f088018b8be93d6a01a
Co-Authored-By: Devananda van der Veen<devananda.vdv@gmail.com>
Closes-bug: #1327397
Prevent clean-up of migrating instances on compute init

During compute manager startup init_host is called. One
of the functions this carries out is to delete instance
data that doesn't belong to this host this function only
checks if the local instance belongs to the host or not.
It doesn't check the task_state. This could result in the
loss of all instance data if it occured at the wrong
point during live migration.

This change checks if the task_state of the instance to
be deleted is MIGRATING and if so it does not delete the
instance. Similarily for the task state RESIZE_MIGRATING.

Change-Id: Ia8c67acf93d71af868907f0711dcc1dfe103560c
Closes-Bug: 1319797
Add more logging to nova-network.

As requested to help debug gate issues.

Related-Bug: #1298472

Change-Id: I5640df721345fe9a878c7c6f8e1c13cfed484112
Test force_config_drive as a boolean as last resort

The force_config_drive help clearly states that only possible option is
'always' but folks are setting it to 'True'/'False' etc and expecting
it to work. So let's enable that as well. In the worst case scenario
mentioned in the bug, it was set to 'False' and since the check for
force_config_drive took any string as true, we were enabling the flag
to true. With the change in this review, we force a conversion of the
string to true. Additional check for the flag to be set as 'always' is
treated as true as well. The test case checks for all the variations

Closes-Bug: #1319180
DocImpact

Change-Id: Ifa6348fa7dfd9de063eb13d30e3ddf94fa530b57
Merge "Fix api direct use of instance module objects"
Merge "Skip migrations test_walk_versions instead of pass"
Merge "Save connection info in libvirt after volume connect"
Merge "Failure during termination should always leave state as error()"
Merge "Add more logging to nova-network."
Merge "Prevent clean-up of migrating instances on compute init"
Merge "Revert "Allow admin user to get all tenant's floating IPs""
Merge "Test force_config_drive as a boolean as last resort"