Add subnet routes to network_info when Neutron is used

This change adds subnet routes to the network_info.

Extensions and future code will now have access to subnet routes.

Change-Id: I0827494dd5c95eb596e526204a2d94fcda2bb0dc
Closes-bug: #1315207
Make remove_volume_connection() use objects

Changes the remove_volume_connection() method in compute manager
to take objects.

Related to blueprint compute-manager-objects-juno

Change-Id: I4fabee87df409accd947db3d5b429f7e871c2d60
libvirt: test setting of CPU tuning data

The setting of the libvirt guest <cputune> data from the
flavor extra_specs quota parameter was never tested. In
fixing this omission, it was noticed that the data was
incorrectly passed around as a string instead of an int.

Change-Id: Ie8b31feddf6c546eb05ca00ead5c56bcd535dd84
libvirt: introduce separate class for cpu tune XML config

Instead of just setting attributes against the main
LibvirtConfigGuest object, have a LibvirtConfigGuestCPUTune
object. This is more flexible when we have to add support
for further cpu tuning attributes.

Blueprint: virt-driver-cpu-pinning
Change-Id: Id3667752fcbbfe3e55ee221fd2cd364d5cfb2f80
vmwareapi: remove unused fake vim logout method

Unused since I50acb4f1e85650f4c6dffe1a1d25842601be96bf removed the
__del__ implementation from the session.

Change-Id: Id3bc92d0c029eb86a43a67de7b9f2311d3a8e20c
vmwareapi: remove unused update_host_status method

The VMWare driver declares a method 'update_host_status'
which has no callers anywhere in the codebase.

This is left over code that was missed in the cleanup from

  commit 2cb47fbabf09ced76178e8453d508c66f86a7a3a
  Author: Arata Notsu <notsu@virtualtech.jp>
  Date:   Thu Oct 18 22:40:01 2012 +0900

    Remove ComputeDriver.update_host_status()

Partial-bug: #1333219
Change-Id: Ie0de9b6d427246cb3c3adb818d483b61dfb08d82
virt: add get_instance_disk_info to virt driver API

The compute manager has been calling get_instance_disk_info on
virt driver implementations during block migration, despite
this method not being declared in the virt driver API. It was
implemented in libvirt and stubbed in xenapi, with different
API signatures in both.

Declare & document it as part of the virt driver API, and
split the libvirt impl into two parts to hide the libvirt
specific notion of XML config.

Partial-bug: #1333219
Change-Id: I38c811f91cce99772ff988a278c32483a219949d
virt: use context & instance as param names in migrate APIs

The vast majority of methods in the ComputeDriver use
'context' and 'instance' as parameter names. The only
exceptions are the migration related methods which use
'ctx' and 'instance_ref'. Change the latter to be
consistently named with the rest of the file

Partial-bug: #1333219
Change-Id: I0457e3e70ee58a9cbfc69f8cfe675de0504cc781
virt: fix signature of set_admin_password method

The compute manager passes (instance, new_pass) to the
set_admin_password method, and the XenAPI driver impl
expects this pair of parameters. The ComputeManager
class, however, declares that it takes (instance, context,
new_pass=None). It makes no sense to default the new
password to None, when the only caller always passes
it, and the context parameter is never passed by the
caller either.

Partial-bug: #1333219
Change-Id: If656da4ef54a0425b9f50ef03af044b803b1afae
virt: add test helper for checking public driver API method names

The virt driver impls of ComputeDriver should only expose public
methods which are already defined by the ComputeDriver base class.
Any other methods should be prefixed with an '_' to indicate that
they are internal helperrs.

Provide a test helper method which the virt driver tests will
call to validate their implementation is in compliance with
the base class signature.

Partial-bug: #1333219
Change-Id: Ibc2369a5f90e09857da29810ac0707614b041d54
libvirt: make method signatures match parent class

Fix any inconsistencies in method signatures between the
libvirt driver impl and the ComputeDriver parent class.
Add a test case to prevent future regressions.

Partial-bug: #1333219
Change-Id: I221433273bd73bb84ed62c8579d45471ac65e1ef
xenapi: make method signatures match parent class

Fix any inconsistencies in method signatures between the
xenapi driver impl and the ComputeDriver parent class.
Add a test case to prevent future regressions.

Partial-bug: #1333219
Change-Id: Ie0be083c684d557c068f8e69a4f0fc38567a1864
ConfigDriveBuilder refactor for tempdir cleanliness

In looking to clean up excessive DEBUG logging, it became clear
that the logging in ConfigDriveBuilder was largely based on the
split logic that existed in doing fs opts in __init__ and then
also later in make_drive. This required a persistent tempdir, which
had to be manually cleaned up. It also meant a mandatory additional
config variable.

Refactor ConfigDriveBuilder to move all fs opts into make_drive,
deprecating the config variable in the process. In doing so, I don't
believe the previous debug logging is useful any more. However, in
case, add a __repr__ for ConfigDriveBuilder that will provide us with
a reasonable debug representation in case this becomes part of what
gets thrown.

Tests are now adjusted to not call private methods, but instead call
make_drive with config variable set.

Change-Id: I1aaf194fef00edd6eecf73b5bb9323e0e3a6f09f
VMware: validate that VM exists on backend prior to deletion

Attempting to delete an instance that does not exist on the backend
throws an exception (for example UnregisterVM may return this when
running the CI).

Change-Id: I1b95caec2dad6580db576aa6f80f47913b7c066e
Closes-bug: #1300788
Pass instance to _reschedule rather than instance_uuid

This is needed so that we can refactor _instance_update and pass the
instance object through to _instance_update and avoid out-of-band trips
to conductor to update an instance object and then have to refresh the
object elsewhere to get database updates.

Part of blueprint compute-manager-objects-juno

Change-Id: Ie9fcf16a7f7c32613e3f01dccd91da190c442ea7
sync policy logging fix from incubator

This change syncs in a delete of an extremely verbose tight loop
debug message in policy.py that generated 8 additional lines for
every wsgi call.

Changes:

238e601b Make policy debug logging less verbose
9c88dc31 file_open: fixed docstring to refer to open() instead of file()

Change-Id: Ifd3f139ebabec9db4a645cd092a810ab22f5085e
Fix bad log message with glance client timeout

Fixes bad log message where when a glance call finally timeouts instead
of a log message saying that it has given up it instead says it is
retrying

Co-Authored-By: qinchenchong@gmail.com

Change-Id: I325918f2d7fa971d4239343131b0f95dae293281
Closes-Bug: 1292993
libvirt: Add configuration of guest VCPU topology

Wire up the libvirt driver to honour the VCPU topology config
requested via the flavor extra specs / image meta. This is
only done for QEMU/KVM guests at this time. Although Xen is
technically capable of supporting this, it is not yet wired
up in libvirt itself.

Blueprint: virt-driver-vcpu-topology
Change-Id: I4540147af7b91e1dc463be63d19afbfcfc1216cb
VMware: optimize VM spawn by caching the vm_ref after creating VM

Commit cebcb28357131a2bf4761bbddebbedf2a7951a11 ensured that the
vm_ref was returned when the VM was created. We now cache this value
to save remote calls to the VC.

Change-Id: Ife2e64703f72a5b4f9b6f5b3cdfb63c2df5cadf7
Updated from global requirements

Change-Id: I51682a7a4b46a88598639c0e779857537dbc2e2c