Zombie images in Ceph

Hello.

I’m running LXD in a cluster for a about a year now and have about 60 containers that were created in a different time.

Now when I list images in Ceph RBD (rbd du -p lxd) I have a number of “zombie_image”-s.
I suppose those are the base images that were used to create my containers.

So I have two questions.
First of all how to prevent these zombies in future? Do I copy an image from remote, make a local alias and use this alias in lxc init? Or is there a better way?

Also how do I get rid of these zombie images now? Do I have to recreate all the containers? Or is there a way to update base image to a new version?

You can’t remove the zombie images unless you remove your containers. See here: https://documentation.ubuntu.com/lxd/en/latest/reference/storage_ceph/

Due to the way copy-on-write works in Ceph RBD, parent RBD images can’t be removed until all children are gone. As a result, LXD automatically renames any objects that are removed but still referenced. Such objects are kept with a zombie_ prefix until all references are gone and the object can safely be removed.