cinder/cinder/tests/unit/brick
Tomoki Sekiyama a953ecea5b Efficient image transfer for Glance cinder store
This adds an implementation of clone_image which offloads
the image copy when the image is stored in Glance Cinder store.
It uses "create_clone_volume" method to create a new volume
from an image that is placed on a cinder volume.

To enable this feature, glance_api_version in cinder.conf must be
set to 2, and allowed_direct_url_schemes must contain 'cinder'.
In glance-api.conf, show_multiple_locations must be set to True.
Also the Cinder store must be enabled.

In addition, if image_upload_use_cinder_backend is set to True,
upload-to-image in raw format will create a cloned volume and
register its location to the image service.
If image_upload_use_internal_tenant is set to True, the image
volume is stored in the internal tenant. Otherwise it is placed
in the current context's tenant.

This also changes LVM driver implementation to enable
image upload. Especially for thin LVM, it modifies
create_cloned_volume method to create thin snapshot LV.
Note that the thin snapshot LV can be treated as the normal
LVs; it can be read/written and can survive after the parent
volume is deleted.

Only raw format image is supported. Otherwise, normal image
upload/download method is used.

Currently Glance Cinder store does not support upload and
download, so the image created by this feature cannot be used
by other projects than Cinder. Patches to provide access to
images stored on Cinder are proposed here:
  glance-specs: https://review.openstack.org/183363
  glance patch(adding rootwrap): https://review.openstack.org/186201
  glance_store patch: https://review.openstack.org/166414

Note that this change works even without Glance patches.

Change-Id: I2cb68749f194d0cd597b7258a317afb982236aea
Implements: blueprint clone-image-in-glance-cinder-backend
DocImpact
2015-08-25 10:40:25 -04:00
..
__init__.py Move unit tests into dedicated directory 2015-04-21 18:40:40 -06:00
fake_lvm.py Efficient image transfer for Glance cinder store 2015-08-25 10:40:25 -04:00
test_brick_lvm.py Fix argument order for assertEqual in tests 2015-08-11 10:09:40 -07:00