Skip to content

Conversation

@hemna
Copy link

@hemna hemna commented Nov 18, 2025

Upon user request, the driver can cache the image as a VM Template and reuse that to create the volume(s). This feature is useful when creating many volumes in parallel from the same image.

We're not using the cinder built-in cache functionality because we need a few extra features:

  • the built-in cache doesn't account for shards. The cache entry will be placed on any backend/shard and could trigger a lot of slower cross-vc migrations when creating volumes from it.
  • the built-in cache doesn't have a periodic task for deleting the expired cache entries
  • we want to cache the images only when the customer requests it

Users can request the image cache feature when creating the volume, by passing the use_image_cache='true' as a property (metadata).

The feature must be enabled per backend, for example:

[vmware]
enable_image_cache = true

This will enable the image cache feature for the vmware backend.

The image templates will then be stored in a folder similar to the volumes folder: OpensStack/Project (vmware_image_cache)/Volumes, where {backend}_image_cache is used as a project name.

The driver will periodically delete the cached images that are expired. The expiry time can be controlled via the property image_cache_age_seconds set on the backend configuration.

Only images smaller than the configured image_cache_max_size_gb will be cached.

Change-Id: Id26f61104339e5ccc1db3a6017f159462c8cba37

@hemna hemna force-pushed the imagecache-antelope branch 3 times, most recently from 7951528 to d2f9c99 Compare November 18, 2025 19:29

def _can_use_image_cache(self, volume, image_size):
requested = (volume['metadata']
.get(CREATE_PARAM_USE_IMAGE_CACHE, "").lower()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this, so the customer does not need to specify anything, and just cache all images that are smaller then 100 GB(can be changed via parameter)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yah I agree, I don't think we should force customers to put some magic, non openstack metadata in their volumes just to enable our internal feature.

Upon user request, the driver can cache the image as a VM Template
and reuse that to create the volume(s). This feature is useful
when creating many volumes in parallel from the same image.

We're not using the cinder built-in cache functionality because we
need a few extra features:
- the built-in cache doesn't account for shards. The cache entry
  will be placed on any backend/shard and could trigger a lot of
  slower cross-vc migrations when creating volumes from it.
- the built-in cache doesn't have a periodic task for deleting the
  expired cache entries
- we want to cache the images only when the customer requests it

Users can request the image cache feature when creating the volume,
by passing the use_image_cache='true' as a property (metadata).

The feature must be enabled per backend, for example:
```
[vmware]
enable_image_cache = true
```
This will enable the image cache feature for the vmware backend.

The image templates will then be stored in a folder similar to the
volumes folder: OpensStack/Project (vmware_image_cache)/Volumes,
where {backend}_image_cache is used as a project name.

The driver will periodically delete the cached images that are
expired. The expiry time can be controlled via the property
`image_cache_age_seconds` set on the backend configuration.

Only images smaller than the configured `image_cache_max_size_gb`
will be cached.

Change-Id: Id26f61104339e5ccc1db3a6017f159462c8cba37
@hemna hemna force-pushed the imagecache-antelope branch from d2f9c99 to 7f30546 Compare November 19, 2025 14:10
@hemna hemna requested a review from Scsabiii November 19, 2025 14:11
@Scsabiii
Copy link

Scsabiii commented Nov 19, 2025

Can we also implement the
copy_image_to_volume in fcd.py with image-cache ?

Scsabiii
Scsabiii previously approved these changes Nov 19, 2025
@Scsabiii Scsabiii force-pushed the imagecache-antelope branch 2 times, most recently from d6be6b8 to 3201607 Compare November 19, 2025 17:11
Change-Id: Id91017bc9c934d99bdfcdafe143a1fed66f06d23
@Scsabiii Scsabiii force-pushed the imagecache-antelope branch from 3201607 to 5a03e6c Compare November 19, 2025 17:33
Change-Id: I31b1337f9f98b3909005150f8581676be8452dae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants