I’m using LXD 3.0.3 on Ubuntu 16.04 with ZFS backend.
I have encountered a strange behavior with ZFS and its clones!
I have created a container with 16.04 image. The image will be downloaded and cloned for the container.
The container has then the image volume as origin:
zfs get all diskpool/lxd/containers/xxx | grep origin
diskpool/lxd/containers/xxx origin diskpool/lxd/images/be4aa8e56eab681fac6553b48ce19d7f34833accc2c8ae65f140a603b8369a1d@readonly -
Now the problem:
It looks like, the image was deleted, while all containers with the origin of the image were stopped.
-> The image was renamed and is now in deleted folder:
The origin of the stopped containers is now changed to reflect the new image path…
When I now start a container, it will start without any issues, but it is now impossible to create a new container, because LXD now want’s to move the image back to the not “deleted” path.
This is not possible anymore, because the running containers use the “deleted” path and the volume cannot be umounted.
I think, the best way of resolving this issue, is to deny to delete an image, which is already in use by a container…