Use VIF details dictionary to get physical_network

Modify mlnx_direct plug and unplug to retrieve physical_network
from VIF details dictionary if network meta dictionary does not contain
physical_network. This will serve ML2 case following the guidelines to
populate vif_details dictionary with attributes required for port plugging.

Change-Id: I0d97bc875be2fff18087c78accef3ec81c059c4b
Closes-Bug: 1304872
Fixes hyper-v volume attach when host is AD member

The domain name gets added to the initiator name used by the host
if it's an Active Directory member.

Currently the method which gets the initiator name does not take
this into account when retrieving the default initiator name.

Trying to use a wrong initiator name will lead to an exception when
trying to log in to the according iSCSI target.

This patch simply appends the domain name (when the host is an AD
member) to the initiator name used to log in to iSCSI targets.

Closes-Bug: #1328870

Change-Id: Ifbe762c685e46081059a01043431b2c4ac5473fc
Add APIv3 support to make host optional on evacuate.

DocImpact: The evacuate target host is now optional. If
'host' field is not sent in the request, the scheduler
will determine the target host. This will include
nova client changes ( on the proper commit ) to support
this new optional parameter.

Implements: blueprint find-host-and-evacuate-instance

Change-Id: I907ea4ef39cfad50a48cb80bceba217fdf482f6e
Co-Authored-By: Juan M. Olle <juan.m.olle@intel.com>
Co-Authored-By: Andres Buraschi <andres.buraschi@intel.com>
Co-Authored-By: Anuj Mathur <anujm@thoughtworks.com>
Co-Authored-By: Navneet Kumar <navneetk@thoughtworks.com>
Co-Authored-By: Claxton Correya <claxton@gmail.com>
check ephemeral disk format at libvirt before use

Add ephemeral disk format at libvirt. There is no check before
so it will be used directly. This patch adds valid check function
and validate it before eph disk was used in virt layer.

Change-Id: I1934573e79f126e725cef4848b15c11a595161c9
Closes-Bug: #1293880
Move retry of prep_resize to conductor instead of scheduler

Prep_resize in Compute Manager calls back Scheduler prep_resize if
an Exception is raised. There is no sense of calling back the
scheduler, it should call Conductor instead.

Implements blueprint move-prep-resize-to-conductor

Change-Id: I2131843c291f5bd01eb4dbd6c8f36a9218120c19
XenAPI: VM diagnostics for v3 API

For V3 API the diagnostics will have the format defined at:
https://wiki.openstack.org/wiki/Nova_VM_Diagnostics

This will support backward compatability with the existing APIs

Part of the blueprint v3-diagnostics

DocImpact

Change-Id: I8377f86a97ca554028e4ca8c1c1af7fd5643cc2e
VMware: Trivial indentation cleanups in vmops

This change has been split out of
https://review.openstack.org/#/c/87002/, which was written by Shawn
Hartsock.

TrivialFix

Co-authored-by: Shawn Hartsock <hartsocks@acm.org>
Change-Id: I6c3ee19b019668a7509ee9835a53271f98805f8f
VMware: Convert vmops to use instance as an object

This is mostly mechanical, but it does expose what appears to be a bug
in the interaction between object.Instance's config_drive field and
configdrive.required_by(). object.Instance defines config_drive to be
a String, but configdrive.required_by() expects it to be a Boolean. In
assigning a boolean value to config_drive, it is cast to a String,
which evaluates as True when cast back to a Boolean. We therefore
update the tests which use config_drive to set either a String value,
or None, which is what other code does.

Note that Nova does not pass an Instance object to all driver methods,
so not all uses can be updated.

Change-Id: Ifc9ce5d96da30abfa09b608a9c8615ede1485a50
Merge "VMware: Trivial indentation cleanups in vmops"
Merge "VMware: Convert vmops to use instance as an object"
Merge "Add APIv3 support to make host optional on evacuate."
Merge "Fixes hyper-v volume attach when host is AD member"
Merge "XenAPI: VM diagnostics for v3 API"
Merge "check ephemeral disk format at libvirt before use"
Merge "Use VIF details dictionary to get physical_network"
Merge "Move retry of prep_resize to conductor instead of scheduler"