Inject expected results for IBM Power when testing bus devices

Same as in https://review.openstack.org/#/c/93621 this patch
inject expected values when the test is running on IBM Power
platform, since the ide bus isn't supported on IBM Power,
and libvirt translate all ide calls directly to scsi
when it's running in power platform

Change-Id: Ibebc96e71a8ba21ae8634e9e22de1cd28f3a7990
Add ibmveth model as a supported network driver for KVM

ibmveth (spapr-vlan) is supported by KVM/Qemu on ppc64. This change
allows users to change hw_vif_model='spapr-vlan' property to use
ibmveth driver.

Change-Id: Ibec6abad458c5cb15df57afa05f7f0742e4feb14
Scheduler: throw exception if no configured affinity filter

If the scheduler hint indicates that the scheduling should perform
either anti-affinity or affinity scheduling and the relevant filter
is not configured then a NoValidHost exception will be thrown.

This is valuable if an existing OpenStack installation is running
and these filters are not defined after an upgrade.

Change-Id: I79bb44ad7481b3ff924687a8d6afdd6c715c0b59
Closes-bug: #1302238
libvirt: add tests for _live_snapshot and _swap_volume methods

The _live_snapshot and _swap_volume methods do a non-trivial
sequence of libvirt API calls which should be validated in the
unit tests

Closes-bug: #1346327
Change-Id: I14bfa08f0dbb4eaa7c4f069f70c257ba7605989b
Only use dhcp if enable_dhcp is set on the network

Also removes an unused call to init_host if there is no network
to setup. The signature of this call was wrong so clearly it was
not being used.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: I33c86b1500f9a69081b4c6ecbe79151f10f69cea
libvirt: remove 3 unused vif.py methods

In the following commit:

  commit 842b2abfe76dede55b3b61ebaad5a90c356c5ace
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Mon Nov 25 14:00:25 2013 +0000

    Increase min required libvirt to 0.9.11

support for setting up OVS outside of libvirt was dropped,
but 3 of the helper methods were mistakenly not deleted.

Related-bug: #1254727
Change-Id: I53de8703a64d1214ec81b9698e376737a92cb53a
Add include_locations kwarg to nova.image.API.get()

To avoid feature envy from image backends that need image location URIs,
functionality of nova.image.glance._get_locations() is moved into
nova.image.glance.show() and exposed via a new include_locations kwarg
to the nova.image.API.get() method, which, when True, simply includes a
collection of location links when the image has them.

blueprint rbd-clone-image-handler
Co-Authored-By: Jay Pipes <jaypipes@gmail.com>

Change-Id: I5118013aa24f68520dee806c24265f2808a90588
Enable cloning for rbd-backed ephemeral disks

Currently when using rbd as an image backend, nova downloads the glance
image to local disk and then copies it again into rbd. This can be very
slow for large images, and wastes bandwidth as well as disk space.

When the glance image is stored in the same ceph cluster, the data is
being pulled out and pushed back in unnecessarily. Instead, create a
copy-on-write clone of the image. This is fast, and does not depend on
the size of the image. Instead of taking minutes, booting takes seconds,
and is not limited by the disk copy.

Add some rbd utility functions from cinder to support cloning and let
the rbd imagebackend rely on librbd instead of the rbd command line tool
for checking image existence.

Adds a new clone() method to the image backend, so backends like rbd can
make optimizations like this. Try to use clone() for the root disk when
it comes from an image, but fall back to fetch_to_raw() if clone()
fails.

Instead of calling disk.get_disk_size() directly from
verify_base_size(), which assumes the disk is stored locally, add a new
method that is overridden by the Rbd subclass to get the disk size.

DocImpact

Implements: blueprint rbd-clone-image-handler
Closes-Bug: 1226351
Co-Authored-By: Josh Durgin <josh.durgin@inktank.com>
Signed-Off-By: Josh Durgin <josh.durgin@inktank.com>
Signed-Off-By: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Signed-Off-By: Dmitry Borodaenko <dborodaenko@mirantis.com>
Change-Id: I0f50659b54a92fc21086990be8925ea15008569a
Merge "Scheduler: throw exception if no configured affinity filter"
Fix ImportError during docs generation

nova/openstack/common/db/sqlalchemy/test_migrations.py has an
explicit import for lockfile but lockfile is missing from
requirements.txt

Change-Id: I8ae62e5235d0348b9fcc30ef6269089930858aa6
Merge "libvirt: add tests for _live_snapshot and _swap_volume methods"
Merge "Add include_locations kwarg to nova.image.API.get()"
Merge "Add ibmveth model as a supported network driver for KVM"
Merge "libvirt: remove 3 unused vif.py methods"
Initialize Ironic virt driver directory

implements bp: add-ironic-driver

Change-Id: Iaee58de9c962d960688015efac95eb1a80cf1296
Merge "Inject expected results for IBM Power when testing bus devices"
Merge "Enable cloning for rbd-backed ephemeral disks"
Merge "Fix ImportError during docs generation"
Merge "Initialize Ironic virt driver directory"
Merge "Only use dhcp if enable_dhcp is set on the network"