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
Fix cold-migrate missing retry info after scheduling

If the resize failed, nova-compute will try to rescheduling this resize
task. But the retry info is missed at resize compute task. This patch
add the retry info back.

Change-Id: I1b60704955e2fb218d047394dd20afe7f971c03d
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
VMware: create utility function for reconfiguring a VM

A utility method has been created that simplifies the process of
reconfiguring a VM.

Change-Id: I184e2483726e29819164175493cfd1559592358b
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
vmware: remove unused delete_disk fake vim method

This is unused since the driver moved away from using DeleteVirtualDisk
in I786365847673e5192a21b654cba951b2e7a6f291

Change-Id: I126b4c069178720250f0dc7fcb924cd3c6c450e5
vmwareapi: remove unused fake vim logout method

Unused since I50acb4f1e85650f4c6dffe1a1d25842601be96bf removed the
__del__ implementation from the session.

Change-Id: Id3bc92d0c029eb86a43a67de7b9f2311d3a8e20c
Update compute rpcapi tests to use instance object instead of dict

Bugs such as 1327145 when the rpc code is accidentally reverted
to passing dicts instead of objects are not currently detected by
the unit tests because these are always called with a dict.

This change updates all compute rpcapi unit test cases to pass
an instance object to all cases where the version has been
converted to objects, so that such issues are now detected.

Related to blueprint compute-manager-objects-juno

Change-Id: I9b974e3a8e8e6dcbf87b1bdc854f05e94e7a35ce
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