Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deleting template does not remove the template images on primary storages #10688

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

Open
weizhouapache opened this issue Apr 10, 2025 · 3 comments
Milestone

Comments

@weizhouapache
Copy link
Member

problem

When delete a template, ACS will remove the image from secondary storages.
however, the template images are not immediately removed on primary storages even if it is not used by any VMs.

versions

4.20 + NFS

I think the issue exists in other ACS versions and storage agonistic

The steps to reproduce the bug

  1. register a template
  2. deploy some vms
  3. expunge the vms
  4. delete the template

now check template_spool_ref table to get the path of template image on primary storages
check the files on storage, they are still there

What to do about it?

More findings:

there are some global settings for template cleanup

  • storage.cleanup.enabled (default: true)
  • storage.template.cleanup.enabled (default: true)
  • storage.cleanup.interval (default: 86400 seconds= 1 day)

the unused templates will be marked as GC in the first round and removed in the next round.
so the templates might be removed in two rounds (2 days with default settings)

since the template has been removed in ACS and it is not used by any VM, we could remove it immediately from primary storages, which will free the storage space as soon as possible.

@harikrishna-patnala
Copy link
Contributor

@weizhouapache I see this change does not effect any other resource in CS, but this looks to me like a behavioral change. Is it okay to go this kind of change in 4.19.3 ?

@weizhouapache
Copy link
Member Author

@weizhouapache I see this change does not effect any other resource in CS, but this looks to me like a behavioral change. Is it okay to go this kind of change in 4.19.3 ?

@harikrishna-patnala
good to have it in 4.19.3. but 4.20.1 or 4.21.0 also looks good to me.

since the template has been removed in ACS and it is not used by any VM, we could remove it immediately from primary storages, which will free the storage space as soon as possible.

what's your opinions on above ? @harikrishna-patnala @DaanHoogland @rohityadavcloud
we actually have the issue in our lab that space of primary storage is not released when a not-being-used template is removed.

@DaanHoogland
Copy link
Contributor

we actually have the issue in our lab that space of primary storage is not released when a not-being-used template is removed.

sounds like a bug that should be fixed in the oldest maintained LTS branch.

shwstppr added a commit to shapeblue/cloudstack that referenced this issue May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants