Not able to restore zfs snapshots

Hello @stgraber @tomp

Hope you guys are doing good :slight_smile: , I am facing issue in restoring lxc snapshots .

Few weeks ago when i was exploring lxc zfs snapshot feature i tested it and it was working fine i had created 4 to 5 snapshots of my container and i was easily able to restore my container to any snapshot like to snap3 or to snap2 and that was amazing . but today i again created a new container and created 3 snapshots of that container now when i want to rollback to snap1 or snap2 of that container its throwing me following error

Error: Snapshot ‘bio800_2020-08-13_13:07:28’ cannot be restored due to subsequent snapshot(s). Set zfs.remove_snapshots to override

i don’t know what is the issue why its doing before and not now. please help me out in this issue as you guys always do.

This is a ZFS-specific limitation.
With ZFS restoring a snapshot makes you lose all subsequent snapshots.
So that’s why it’s telling you that to restore snap2 you need to delete snap3 first and that for snap1 you’d need to delete both snap2 and snap3.

You can still copy from any snapshot into a new container, so can copy blah/snap1 into blah1 without losing any of the snapshots on blah.

1 Like

Thanks a lot !
can you please tell me how to limit a container storage limit using btrfs file system ?

btrfs works the same way as ZFS, you set the size property on the root device.

The main annoyance is that this isn’t visible in df, so the user will always see the entire size of the partition rather than what they got allocated…

Also, btrfs quota groups are unfortunately trivial to bypass, so if you’re running untrusted code or have untrusted users use the container, beware, they can bypass the quota by creating subvolumes.

ok thanks for the info

This doesn’t work. I have a Virtual Machine with 3 snapshots. I want to create a new VM with snapshot 2 (it has a unique name, I’m not making the rookie error of not counting from zero).

lxc copy [container]/[snapshot] [host]:[new_container_name] --verbose --mode=push

produces a new VM running the latest content, not the specified snapshot.