Unable to delete either container or snapshot

I have a strange situation where I cannot delete a container.
This is the story so far:

  • Initially I had created a container with “directory” as storage. I had also 1 snapshot for the container.
    This container was created with a 3.0.X version of lxd (non-snap)

  • Then I wanted to change storage.
    First of all I upgraded to the snap/stable version of lxd (I read this was needed because of ‘lxc move’)
    Then I created a new storage (lxc storage create ).
    This time I chose zfs.

  • Then I moved the container from the old to the new storage (lxc move --storage)

  • Everything seemed fine. The container was moved, along with its snapshot.
    And I could enter the container shell.

Now I wanted to delete that container, which is not anymore needed.


lxc delete CONTAINER
–> Error: Cannot remove an instance volume that has snapshots


–> Error: Failed to run: zfs get -H -p -o value -r clones STORAGE/containers/CONTAINER@snapshot-SNAPSHOT:
cannot open ‘STORAGE/containers/CONTAINER@snapshot-SNAPSHOT>’: dataset does not exist

Do you have any hints?
Thank you!

Can you show zfs list -t all?

Chances are the snapshot was somehow deleted from ZFS and is now confusing LXD.
An easy workaround is to create the snapshot that’s missing, something like zfs snapshot STORAGE/containers/CONTAINERS@snapshot-SNAPSHOT

You are right. The snapshot was not there in zfs.
Your workaround worked perfectly…around :slight_smile:
Thank you very much!