VMware ESX: Boot from volume must not relocate vol

ESX does not support relocate API. Moreover when working with ESX the boot
from volume logic need not perform relocation since the volume's datastore
is always visible to the ESX host.

The fix is to ignore relocation when working with ESX.

Change-Id: I227cf2ea5b6f681150ede0bf6257eb238f1452d2
Closes-bug: #1244918
Make libvirt wait for neutron to confirm plugging before boot

This makes the libvirt driver use the instance event mechanism to
wait for neutron to confirm that VIF plugging is complete before
actually starting the VM.

Here we introduce a new configuration option of vif_plugging_is_fatal
which allows us to control whether a failure to hear back from
neutron is something that should kill the current operation. In
cases where consoles are not provided for the guest, failing is
the only reasonable action, but if consoles *are* provided, it may
be advantageous to still allow the guest to boot and be accessed
out of band.

In order to properly reflect the neutron failure in the instance's
fault property, this also extends manager to catch and re-raise
the VirtualInterfaceCreateException during spawn(). Also, since
the oslo.messaging merge, we weren't declaring expected exceptions
for run_instance() which this also fixes.

DocImpact: This requires a neutron that is aware of these events
           when using nova with neutron, or a configuration that
           causes nova not to expect/wait for these events.
Related to blueprint admin-event-callback-api

Change-Id: I2f771d8bade513d2e54d98a176069011950830aa
Add version 3.0 of scheduler rpc interface

This commit adds a new major revision to the rpc interface used to
talk to the scheduler service.  The old version will be retained in
Icehouse for Havana rolling upgrade capability.  2.x can be dropped
as soon as Juno development opens.

When 2.x gets dropped, we will be able to remove the following methods
from the scheduler manager, as well as all other supporting code for
these methods throughout the scheduler:

  - create_volume()
  - live_migration()
  - show_host_resources()
  - get_backdoor_port()
  - select_hosts()

We can also drop backwards compatibility handling for the absence of
any parameters added to other methods during 2.x.

Note that the client side will only send 3.0 messages, but that's
fine.  We expect the nova-scheduler service to get updated at the same
time as, or before anything that uses this client code.

Part of blueprint rpc-major-version-updates-icehouse

Change-Id: Icca32ff1defbab06f9e9cd726b3ffa25d9fedf1e
Fix input validation for V2 API server group API extension

The server group extension create method allows the name
parameter to not be a string. The unittest which tests that an integer
passed as the name fails, but this is due to the policies parameter
missing from the test data, not because the name is invalid.

The internal nova code silently converts floats, integers, etc to strings
and so also does not pick up the validation issue.

The patch adds extra input validation to the API layer to pick up this issue
and also tightens the acceptable values of the string to reject trailing
or leading whitespace which if used can cause confusion for users. It uses
the regexp that the other parts of the API are converging towards to use
as a common acceptable name across the API rather than having different
criteria for names for different extensions.

Also ensures input validation is always properly applied to the policies
parameter and adds test cases. This part is backported from this
https://review.openstack.org/#/c/79312/5 patch.

The patch also fixes the broken unittests and adds new ones to test the
tightened criteria for the name parameter.

+DocImpact
Co-authored-by: Gary Kotton <gkotton@vmware.com>
Closes-Bug: 1290326

Change-Id: I9ddaef8a128ac6a1a448e47d6b3c9abcf719eb76
Merge "Fix input validation for V2 API server group API extension"
Merge "VMware ESX: Boot from volume must not relocate vol"
Merge "Make libvirt wait for neutron to confirm plugging before boot"
Merge "Add version 3.0 of scheduler rpc interface"