How to Enable Image Cache in Block Storage
Problem
Creating volumes from images can be slow, especially when the same image is used repeatedly. This can lead to increased I/O load and longer provisioning times. Enabling image caching in PCD's Block Storage (Cinder) service can significantly improve performance by storing a cached copy of frequently used images.
Environment
- Private Cloud Director Virtualization - v2025.4 and Higher
- Private Cloud Director Kubernetes – v2025.4 and Higher
- Self-Hosted Private Cloud Director Virtualization - v2025.4 and Higher
- Self-Hosted Private Cloud Director Kubernetes - v2025.4 and Higher
Procedure
- Edit Cinder Backend Configuration: On the host where the Persistent Storage (or Cinder Volume) role is enabled, add the following parameters in the
[DEFULT]section of the/opt/pf9/etc/pf9-cindervolume-base/conf.d/cinder.conf
image_volume_cache_enabledimage_volume_cache_max_countimage_volume_cache_max_size_gbAdjust image_volume_cache_max_count and image_volume_cache_max_size_gb based on the available disk space and use case.
For Example:
image_volume_cache_enabled = Trueimage_volume_cache_max_count = 50image_volume_cache_max_size_gb = 200If NFS is configured as the backend for block storage, then do not enable image caching. Set image_volume_cache_enabled = False to avoid issues related to root disk sizing. (Known issue PCD-2623)
- After updating the configuration, restart the
pf9-cindervolume-baseservice for the changes to take effect:
$ sudo systemctl restart pf9-cindervolume-baseValidation
Check if Image Cache is Enabled: Verify the effective configuration using the following command on the cinder node:
$ grep image_volume_cache /opt/pf9/etc/pf9-cindervolume-base/conf.d/cinder.confAdditional Information
What Each Parameter Means:
image_volume_cache_enabled: Enables or disables the image caching mechanism.image_volume_cache_max_count: Limits the number of images to cache. If the limit is reached, the least recently used (LRU) image will be evicted.image_volume_cache_max_size_gb: Limits the total size (in GB) of all cached images. The LRU policy also applies here when the limit is hit.