3.6. Configuring the Block Storage Image-Volume cache feature
You can enable Image-Volume cache in the Block Storage service (cinder) to improve the speed of volume creation from frequently-used images.
When you enable Image-Volume cache, the first time you create a volume from an image, a copy of the image volume is cached in the internal Block Storage project, cinder-internal. Subsequent requests to create volumes from the image clone the cached copy instead of downloading the original image contents and copying data to the volume.
You can configure Image-Volume cache per back end. If you are using a third-party back end, refer to the storage vendor’s documentation for information about Image-Volume cache support.
You can set the limit of the Image-Volume cache to a size in GB, number of images, or both.
Prerequisites
-
You have configured the internal Block Storage service project,
cinder-internal. For more information, see 第 3.5 节 “Creating an internal project for the Block Storage service”.
Procedure
Open your
OpenStackControlPlaneCR file,openstack_control_plane.yaml, and add the identifiers for yourcinder-internalproject and project user to thecindertemplate. In this example, you are using Red Hat Ceph Storage as the back end for the Block Storage service.Example:
apiVersion: core.openstack.org/v1beta1 kind: OpenStackControlPlane spec: extraMounts: ... cinder: template: cinderVolumes: ceph: customServiceConfig: | [DEFAULT] cinder_internal_tenant_project_id = <project_id> cinder_internal_tenant_user_id = <user_id> ...-
Replace
<project_id>with the ID of yourcinder-internalproject. -
Replace
<user_id>with the ID of yourcinder-internalproject user.
-
Replace
Add the following parameters to enable Image-Volume cache and to configure the size limit of the cache and the maximum number of images that the cache can store:
Example:
... customServiceConfig: | [DEFAULT] ... [ceph] image_volume_cache_enabled = True image_volume_cache_max_size_gb = <max_size> image_volume_cache_max_count = <max_number> ...-
Replace
<max_size>with the size limit of the cache in GB. -
Replace
<max_number>with the maximum number of images to store in the cache.
-
Replace
Update the control plane:
$ oc apply -f openstack_control_plane.yaml -n openstackWait until RHOCP creates the resources related to the
OpenStackControlPlaneCR. Run the following command to check the status:$ oc get openstackcontrolplane -n openstackThe
OpenStackControlPlaneresources are created when the status is "Setup complete".提示Append the
-woption to the end of thegetcommand to track deployment progress.