VMware: spawn refactor - DatastorePath class

Part of spawn refactor work to consolidate a lot of the datastore path
manipulation code. The DatastorePath class is a simpler version of a
class of the same name in earlier versions of
https://review.openstack.org/#/c/87002, and is intentionally limited in
the ways that DatastorePath objects can be constructed. No attempts are
made to ensure that the datastore, directories and files referenced in
these objects are valid on the remote system.

partial blueprint vmware-spawn-refactor

Change-Id: Id65d0308d32835048229e7a3d98b84af2b13583c
VMware: remove dsutil.split_datastore_path

The functionality of split_datatore_path has been subsumed by
the DatastorePath utility class, so remove it and convert
all callers to use the latter.

Change-Id: I07a2cfe15fccaca4aee25bc43157e6c604b91831
VMware: spawn refactor - Datastore class

Introduces the start of a simple Datastore class to encapsulate relevant
data of a datastore.

partial blueprint vmware-spawn-refactor

Change-Id: Ic0ee6cdd47e7cbd66cf456776c61d0b85fb51a0a
Sync revert and finish resize on instance.uuid

We need to make sure we sync the state of the instance the same way we
do for do_confirm_resize. Previously, we were not syncing the instance
on revert or finish resize. We do this so that we can update the
migration and instance resize update orders. Previously if you set
resize_confirm_window to some small value, your resized instance could
go into error state because the periodic task was run after the
migration was updated but before the instance object was updated. This
change makes it so the instance is always updated before the migration.

Change-Id: Iaad1a05864b2b46180cadf16198b0fd8583c6703
Closes-Bug: 1326778
Fix the rest of direct uses of instance module objects

This switches the remaining occurences of
nova.objects.instance.Instance* to nova.objects.Instance*.

Partial-Blueprint: object-subclassing

Change-Id: I3017c149cc9fbc6b1fbecb003dc55455b1dcd12c
Fix object code direct use of other object modules

The object code itself should not explicitly reference its own objects,
as objects could be subclassed.

Also: There were a few objects that had their own __init__()s that
didn't support accepting 'context' or kwargs. At some point here, we
should also require that context is passed when instantiating the
objects. So, I added the (currently optional) context argument on some
object instantiations near the places I was touching.

Partial-Blueprint: object-subclassing

Change-Id: Icf631c770e347b4bb32999c4ba2431d1db49e11c
Updated from global requirements

Closes-Bug: #1333410

Change-Id: I49d5ee76ef8aed2cbbeec0377c119d3feeea4eca
Add API schema for v2.1/v3 remote_consoles API

By defining the API schema, it is possible to separate the validation
code from the API method. The API method can be more simple.
In addition, a response of API validation error can be consistent for
the whole Nova API.

Partially implements blueprint v3-api-schema

Change-Id: Icdb1f87903e3c4345e6533c08b2f2d2f9d36316e
Add Agent object

This adds an object interface for the AgentBuild entity we store
in the database.

Related to blueprint compute-manager-objects-juno
Related to blueprint virt-objects-juno

Change-Id: Idf9b4f025d234dce5bbc8f728b5e0900cf9e1e42
Object-ify xenapi driver's use of agent_build_get_by_triple()

This makes the xenapi driver use the new Agent object instead of
making a VirtAPI/conductor raw call back to the database.

Related to blueprint virt-objects-juno

Change-Id: I8498c6f3e2fa5d614ac301402d2be778e5edb74e
Deprecate and remove agent_build_get_by_triple()

This method was only used in the xenapi driver, which has since been
converted to use Objects. This removes the call from VirtAPI, the
conductor API, and deprecates it from conductor manager.

Related to blueprint compute-manager-objects-juno

Change-Id: I43b8c4bc201361ce79d56cac91a8944d18c03ab2
libvirt: add '_' prefix to some get_host_* methods

The get_host_uuid, get_host_capabilities and get_host_cpu_for_guest
methods are all internal helpers so should have a '_' prefix to
indicate they are not part of public virt driver API.

Related-bug: #1333219
Change-Id: Ice22f52ef1f4ec0b950b5fdf303499ea5c2ba7be
Use default rpc_response_timeout in unit tests

During running of tox the system can timeout on slower systems.
We have seen this occur in our internal tests and have seen
better results when we increased the api timeout from 15 to 60
seconds.  This can be used until faster hardware is availale
or a better fix is proposed.  Andrew Laski first proposed
this fix.

Closes-Bug: 1311778

Change-Id: I33da328e7bea8fbdde3f01ee0147b4c5a3a278d2
Merge "VMware: spawn refactor - DatastorePath class"
Merge "VMware: remove dsutil.split_datastore_path"
Merge "VMware: spawn refactor - Datastore class"
Merge "libvirt: add '_' prefix to some get_host_* methods"
Merge "Add API schema for v2.1/v3 remote_consoles API"
effectively disable libvirt live snapshotting

As being seen in the gate, libvirt 1.2.2 doesn't appear to actually
handle live snapshotting under any appreciable load (possibly
related to parallel operations). It isn't a 100% failure, but it's
currently being hit in a large number of runs.

Effectively turn this off by increasing the
MIN_LIBVIRT_LIVESNAPSHOT_VERSION to something that doesn't yet
exist. This can get us back to a working state, then we can decide
if live snapshotting is something that can be made to actually work
under load.

DocImpact

Related-Bug: #1334398

Change-Id: I9908b743df2093c8dd2723af89be51630eafc99f
Make Evacuate API use Instance objects.

Replace current instance dicts and conversions to Instance Objects.
Add services arg to create_fake_instance_obj.

Change-Id: I7ddf11ce17df254a8253461e17b5c6519cb7d6fe
Related to blueprint compute-manager-objects-juno