-
Notifications
You must be signed in to change notification settings - Fork 2
[vmware] Cache images as VM templates #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stable/2023.1-m3
Are you sure you want to change the base?
Conversation
7951528 to
d2f9c99
Compare
cinder/volume/drivers/vmware/vmdk.py
Outdated
|
|
||
| def _can_use_image_cache(self, volume, image_size): | ||
| requested = (volume['metadata'] | ||
| .get(CREATE_PARAM_USE_IMAGE_CACHE, "").lower() |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
d2f9c99 to
7f30546
Compare
|
Can we also implement the |
d6be6b8 to
3201607
Compare
Change-Id: Id91017bc9c934d99bdfcdafe143a1fed66f06d23
3201607 to
5a03e6c
Compare
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:
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:
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_secondsset on the backend configuration.Only images smaller than the configured
image_cache_max_size_gbwill be cached.Change-Id: Id26f61104339e5ccc1db3a6017f159462c8cba37