VMware Compute Driver Glance improvement

blueprint vmware-compute-driver

Glance change to fix image download to ESX
The current glance code downloads files in a blocking/synchronous
manner, the fix improves it to work with ESX glance file reader
in a non-blocking manner.
This allows ESX glance file reader to read items from the returned
queue.

Change-Id: I05ab7ac00878aeeea3bbcd7546b05398f2630dd3
Removes retry of set_admin_password

* An RPC timeout may occur if an agent is missing and set_admin_password is
invoked. This causes 500 errors in the OpenStack API.
* Implemented a 501 error in API if the password set fails.
* Modified xenapi agent to use NotImplementedError instead of Exception in
  set_admin_password.
* Updated test code around set_admin_password to accept different exceptions.
* Fixes bug 1061045

Change-Id: If7fab56c20f12e0490f4774e00004ed1d94242b9
Add api samples to fping extension

Partially implements bp nova-api-samples
Fix bug 1091747

Change-Id: Ic0060b8ea2a01a304c337a31dc276cbf395c2e5d
Add support for compressing qcow2 snapshots

Fixes bug 1109923

Adds a new configuration option:
    libvirt_snapshot_compression=False (Default)

When set to True and the snapshot output format is qcow2, we pass
the -c option into qemu-img, which enables compression. This patch
also refactors the extract_image function to make construction of
the whole qemu-img command more dynamic.

Change-Id: I7a7ebcf41a91a8a9cb14be79e9bb79c22acb136e
Flags: DocImpact
Code cleanup for rebuild block device mapping

* Removes extra call to get block-device-mappings when detaching during
  recreate.

* Untangle network handling from block-device handling in rebuild

* DRYs up evacuate hosts tests

* Temporary mutation supports dicts as well as objs

* Make instance recreate exceptions more specific to aid testing

Change-Id: I242f9f6a7d329f27b06b7e81b9a418e01682c82e
xenapi: Ax unecessary `block_device_info` params

The xenapi driver uses the 'osvol' other_config to determine which
volumes to detach, making `block_device_info` unecessary for internal
functions.

`destroy` still needs to accept the param since it's part of the
virt-driver API.

Change-Id: I1bbd69f41f9a1e18d4759d0ef3c6de027d3c9981
Use _prep_block_device in rebuild.

This patch makes rebuild slightly more similar to build by calling the
same function to prep block devices.

Change-Id: I3040b49578ad0351be7819c29a449799f50c82a9
DRYing up volume_in_mapping code.

Libvirt, VMWare, and Xen drivers all reimplement this method. This
refactors the code into the `block_device` module so all drivers can
share it.

Future Work: Refactor xen so that strip_prefix doesn't need to be passed
to `volume_in_mapping`.

Change-Id: I026b655f2eb7ea9cebe84058749c05ce93bcb7d4
Fix rebuild with volumes attached

This patch assumes that the correct behavior for instance rebuild is to
maintain attached volumes across a rebuild operation.

Two important changes are:

1) Detaching all volumes during a rebuild so that they won't be 'in-use'
   when prep_block_devices is called to reattach them.

2) xenapi: Allowing additional volumes, not just root volumes, to be
   attached before boot. To handle this, we cycle through all
   block-device-mappings, not just the root-device, create the VDI, and
   later, create the VBD.

Small changes include:

* Using `connection_data` instead of `dev_params` (to match other parts of
  the code base)

* Renaming `get_vdis_for_boot_from_vol` to `get_vdi_uuid_for_volume` to
  reflect its more general and simpler semantics.

Fixes bug 1071547

Change-Id: Ie54a16be4bae2a718ed7d506f32777d0847b9089
Use conductor for instance_info_cache_update.

This patch updates the network API to be able to use the conductor API
to be able to update the instance info cache.

A previous commit, 5731852f91c32fe09db541888d3fee9e3139fc43, updated
the compute manager to use this method from conductor when getting
network info.  This patch builds on that by moving the conductor usage
down to the network API and using it in more places.  Specifically, the
network API calls used by the compute manager that use the refresh_cache
decorator were updated.

The refresh_cache decorator now checks for a conductor_api kwarg and
will use the conductor to update the cache if it's not there.  Otherwise
it goes back to default behavior of using the db directly.

Change-Id: Ib5e17f5f8fb4ee14e3ed305057d18d40f2e905e5
Merge "Add api samples to fping extension"
Merge "Code cleanup for rebuild block device mapping"
Merge "xenapi: Ax unecessary `block_device_info` params"
Merge "Use _prep_block_device in rebuild."
Merge "DRYing up volume_in_mapping code."
Merge "Fix rebuild with volumes attached"
Fixes FloatingIPDNS extension 'show' method.

Changes the 'show' method to also work when 'id' is actually
an IP and calls the right method to return a list of DNS entries
for a given domain and IP when the called method is
'v2/{tenant_id}/os-floating-ip-dns/{domain}/entries/{ip}'.

Fixes bug 1089410

Change-Id: I4c424e091209624324754c548e55bbbb304cf79f
Fixes unhandled exception in detach_volume

* Fixes the use case where an exception should have been raised when libvirtd
goes down and a volume is being detached.
* Added unit tests for detach_volume, but skipped one unit test for compute
cells as it is giving an error (TypeError: detach_volume() takes exactly
3 arguments (4 given))

Fixes bug #1101079
Change-Id: I6d83947a0344c5f2d91014de6a2052a881198bb4
Merge "Fixes unhandled exception in detach_volume"
Merge "Fixes FloatingIPDNS extension 'show' method."