Fix incorrect kwargs 'reason' for HTTPBadRequest

webob.exc.HTTPBadRequest doesn't have attribute 'reason', and its
__init__ method doesn't have such parameter too, so if we use such
kwargs, it will not be accepted by constructor of base class
WSGIHTTPException, then the http response body will format message
using default explanation instead of what we expected.

We should use kwargs 'explanation' instead of wrong 'reason'.

Change-Id: I02619164176a723e313ae274e527948d45fa6cad
Closes-Bug: #1264223
VMware Driver update correct disk usage stat

The nodes managed by VMware VCDriver driver can have multiple
datastores (disk abstraction) attached to it. The driver currently
reports the disk usage of a datastore that has the largest capacity.
But it doesn't report a consolidated disk usage. As a result, the
node's storage capability is under-reported in many occassions.

This patch fixes this issue by aggregating the disk freespace,
capacity from all attached datastores.

Closes-Bug: #1220459

Change-Id: I818a041f33a045773fc799de2c69628064ef8cbf
Prevent thrashing when deploying many bm instances

Nova BM is easily overwhelmed at the moment because it has to convert
every disk image to raw - simply deploying 2 instances at once exceeds
the IOPS on most single disk servers. Avoid this by serialising the
image conversion (which leads to a lower average-time-to-deploy in
nearly all situations).

Change-Id: I6d5ee97ffdbd497802379b13e70b84d70d8ded57
Co-Authored-By: Steve Kowalik <steven@wedontsleep.org>
notifier middleware broken by oslo.messaging

audit middleware in oslo-incubator is incompatible with oslo.messaging.
an oslo.messaging compatible version is available in pycadf library.
remove broken oslo-incubator code in this patch.

also add middleware/request_id to openstack-common.conf so we continue
to pull in request_id middleware but not audit/notifier.

Partial-Bug: #1280327
Change-Id: I665144b256da0b04267cac754324e5779512e65d
Fixing host_ip configuration help message

The vCenter/ESXi client can only accept a hostname or IP address
and not a URL.  Fix the help message to accurately describe what
kind of address is accepted.

Change-Id: Ie90247195181189d22e727a855145313397550ca
Closes-Bug: #1274294
VMware: refactor _get_volume_uuid

It is more efficient to ask vCenter for specific extraConfig property instead
getting all properties and then manually searching the one which is
needed.

Closes-Bug: #1257726
Change-Id: I4fc8399c9a8b6a141ac489e8fb92117ec03ca42f
Ignore the image name when booting from volume

In 0185d2445 the _run_instance method was changed to acquire the image
metadata from the request_spec instead of glance. This was needed to be
able to get the image_metadata attached to a volume, when booting from
it. That change didn't consider that the image name key is not inherited
when creating a volume from an image and introduced a bug when creating
the usage_info for volume booted instances.

This change fixes this by only attaching the image name to the usage_info
only when booting from an image and not when booting from a volume.

Related-Bug: 1281973
Change-Id: I8ec441e7815855a94a28c4566790d5144deff16f
Address the comments of the merged image handler patch

Three minor things which was commented in change:
Idce8d21ae37bfdbb28a2567120a83d1061061904

Change-Id: Idd899ec2c177c9b5695b6908bc897fe3e759beca
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Merge "Ignore the image name when booting from volume"
Merge "Fixing host_ip configuration help message"
Merge "VMware Driver update correct disk usage stat"
Fix development environment docs for redhat-based systems

This adds the new libffi-devel dependency to the devref for new
development environment creation.

Change-Id: I63e0302cffe33b05722579e7d9c7122f2f257843
Merge "Fix incorrect kwargs 'reason' for HTTPBadRequest"
Merge "Address the comments of the merged image handler patch"
Merge "Prevent thrashing when deploying many bm instances"
Merge "VMware: refactor _get_volume_uuid"
Merge "notifier middleware broken by oslo.messaging"
Move instance delete to new-world BDM objects

Move all the code paths related to instance deletion to new-world
objects. This includes soft- and hard- deletes, instance init on compute
startup, as well as the reclaim_queued_deletes and
_cleanup_running_deleted_instances  periodic tasks.

It introduces an additional database call in the _shutdown_instance
method as there are still paths that call this method but will not pass
it BDM objects. This will be removed as soon as _reschedule_on_error
(basically meaning instance spawn) code paths are moved to BDM objects.

Part of blueprint: icehouse-objects
Part of blueprint: clean-up-legacy-block-device-mapping

Change-Id: Ic63a3afb77362f0797c546a9505fa4bd7a9b986e
Move detach_volume and remove_vol_connection to BDM objects

This patch moves detach volume code paths to use BDM objects. Since both
detach_volume and remove_volume_connection compute manager methods,
since both of them use the _detach_volume method that needed to be
converted as well.

Part of blueprint: icehouse-objects
Part of blueprint: clean-up-legacy-block-device-mapping

Change-Id: I1e9af9be0ea318f568180ddbd6cd0a25e8bb0bfd
Merge "Fix development environment docs for redhat-based systems"