Adding host attaching support to Cinder

Changing 'os-attach' API interface to allow client mark a volume as be
attached to a host.

Implement bp: volume-host-attaching
docimpact

Change-Id: Iaf442ad0fb37ce369d838f3a512724f830071763
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
xenapi: implement xenserver image to volume

Amend image_utils, so that it could handle xenserver type images (vhd
chains inside a tgz archive). This requires the vhd-util binary, if the
image contains a vhd chain (e.g.: snapshot)

DocImpact
- Copy a XenServer type OpenStack image (tgz -ed vhd chain) is now
  supported.
- To use the above functionality, the cinder box must have access to the
  vhd-util binary. In ubuntu, this is done by apt-get installing
  blktap-utils.

Change-Id: I99b58868439c4d5187c2fe3666110bfda0924181
Quotas by Volume Type

The VolumeTypeQuotaEngine creates a volume, snapshot, and gigabyte
quota for each volume type that exists, in addition to the existing
global quotas for each. These are queried every time a quota operation
happens.

The resources for creating quotas are named: volumes_<vtype>,
gigabytes_<vtype>, and snapshots_<vtype>.

Another patch will have changes to cinderclient for setting project
quotas by volume type.

blueprint quotas-limits-by-voltype
DocImpact

Change-Id: I88261676edcd6eb5b7cea40654a931f32c00815c
Skip brick_initiator test in virtual environments

/dev/disk/by-path does not exist in certain virtual
environments. Skip the test.

Fixes LP Bug #1196464

Change-Id: Ifc5bb061db59aaa6b7c089eda5e4eb1c9eff2dbf
Make os-services API extension consistent

Updates the os-services API extension so that it is consistent
internally (index and update return similar formats), and so
that it works with the following cinderclient code changes which sends
the the following request body format:

  {"binary": "cinder-volume", "host": "host1"}

It addresses a similar issue which happens in nova os-services extention
before. https://bugs.launchpad.net/nova/+bug/1147746

This change added 'binary' key in request and 'status' key in response
while still keeping 'service' ane 'disabled' key for API compatibility
sake.

Implements blueprint os-services-extension

Change-Id: I7f3fa889294ca6caebdf46b8689345bcac1cdf54
CoraidDriver: Create_volume_from_snapshot of a different size

When you create a Volume from a Snapshot, the 'size' argument for the
new volume isn't used at all.
So, the new volume created will be created (successfully but) with the
same size as the snapshot size.

Cinder think the volume has been created with the right size.

We just need to call Coraid ESM LV Resize with the REST API after
the volume has been created.

Fixes bug 1158959

Change-Id: I760fe1ba4052bb2d5b1a1a5c55c9a976522af107
Imported Translations from Transifex

Change-Id: I488133a2ae2c0f04dfd91bc85107df58c701ab41
Merge "Adding host attaching support to Cinder"
Add execute wrapper to brick LVM code.

Add an execute wrapper to the brick lvm code and
enable the ability to pass in a desired executor other
than just using the default common/processutils executor
if there's some reason to do so.

This will enable the switch of the cinder/volume/drivers/lvm.py
driver to continue using cinder/utils execute until we switch over
to common/processutils and also helps immensely with the tests.

Change-Id: Iaecba475debb2100d0c40b5e54ece6d4420271c5
Merge "Imported Translations from Transifex"
Merge "Skip brick_initiator test in virtual environments"
Rename cinder.flags to cinder.common.config

Replace FLAGS with cfg.CONF
Rename modules fake_flags to conf_fixture, test_flags to test_conf, declare_flags to declare_conf, runtime_flags to runtime_conf
Renamed cinder.flags, because exactly the same was done in the glance and nova

Fixes: bug #1182037
Change-Id: I3424d0a401b3ef7a3254d3e913263554361a52ff
Fix typo 'Flase' -> 'False'

Change-Id: I986a943d06d715ac7bc284d5ebdf1d8963f5dc3e
Scheduler should not select down volume managers

Currently volume managers that are not disabled, but are not running
may be selected by the scheduler for volume creation operations.

Change-Id: Ia06a3da8b31eef918d55aaaf71f863683c721026
Fixes: bug #1197741
Merge "Quotas by Volume Type"
Merge "Make os-services API extension consistent"
Merge "Fix typo 'Flase' -> 'False'"
Merge "xenapi: implement xenserver image to volume"
Merge "Scheduler should not select down volume managers"
Merge "Rename cinder.flags to cinder.common.config"