weizhouapache opened a new issue, #10688:
URL: https://github.com/apache/cloudstack/issues/10688

   ### 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to