This patch is part of the docs migration for Cinder. It is more or less a drag and drop of the docs from openstack-manuals admin-guide directory. I needed to change some syntax to work with Cinder's more stringent doc build. Note that the purpose of this patch is just to get the documentation back to an accessible location. Later patches will clean up the organization and content. Change-Id: Ib3f9255e0f9f2ff42a0ee4126607ff319a3d901e
2.9 KiB
Volume-backed image
OpenStack Block Storage can quickly create a volume from an image that refers to a volume storing image data (Image-Volume). Compared to the other stores such as file and swift, creating a volume from a Volume-backed image performs better when the block storage driver supports efficient volume cloning.
If the image is set to public in the Image service, the volume data can be shared among projects.
Configure the Volume-backed image
Volume-backed image feature requires locations information from the
cinder store of the Image service. To enable the Image service to use
the cinder store, add cinder
to the stores
option in the glance_store
section of the
glance-api.conf
file:
stores = file, http, swift, cinder
To expose locations information, set the following options in the
DEFAULT
section of the glance-api.conf
file:
show_multiple_locations = True
To enable the Block Storage services to create a new volume by
cloning Image-Volume, set the following options in the
DEFAULT
section of the cinder.conf
file. For
example:
glance_api_version = 2
allowed_direct_url_schemes = cinder
To enable the openstack image create --volume <volume>
command to create an image that refers an Image-Volume
, set
the following options in each back-end section of the
cinder.conf
file:
image_upload_use_cinder_backend = True
By default, the openstack image create --volume <volume>
command creates the Image-Volume in the current project. To store the
Image-Volume into the internal project, set the following options in
each back-end section of the cinder.conf
file:
image_upload_use_internal_tenant = True
To make the Image-Volume in the internal project accessible from the
Image service, set the following options in the
glance_store
section of the glance-api.conf
file:
cinder_store_auth_address
cinder_store_user_name
cinder_store_password
cinder_store_project_name
Creating a Volume-backed image
To register an existing volume as a new Volume-backed image, use the following commands:
$ openstack image create --disk-format raw --container-format bare IMAGE_NAME
$ glance location-add <image-uuid> --url cinder://<volume-uuid>
If the image_upload_use_cinder_backend
option is
enabled, the following command creates a new Image-Volume by cloning the
specified volume and then registers its location to a new image. The
disk format and the container format must be raw and bare (default).
Otherwise, the image is uploaded to the default store of the Image
service.
$ openstack image create --volume SOURCE_VOLUME IMAGE_NAME