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

Open
@weizhouapache

Description

@weizhouapache

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions