ZFS: Snapshot Rollbacks & Clones

impeding8615

New Member
Aug 27, 2022
7
0
1
Hi,
I run my Proxmox with ZFS mainly for data protection reasons.
It always bothered me that I could rollback only to the latest snapshot, but not to older ones.
Only today I noticed that I can't even create a Clone from an older snapshot. That's also possible only from the latest snapshot.
tl/dr: Its not possible to go back to an earlier snapshot without deleting all the newer ones.

From now on I really need this feature on a regular basis.
What options do I have? I really want to stay with ZFS.

How do you handle this?
 
Only today I noticed that I can't even create a Clone from an older snapshot. That's also possible only from the latest snapshot.
in the GUI yes, you can create clones from whatever you want on the CLI. If you need something from before, just clone the before snapshot and extract what you need.

It always bothered me that I could rollback only to the latest snapshot, but not to older ones.
You can also rollback to whatever you want, but you will lose everything from now to then. Clone helps here.
 
in the GUI yes, you can create clones from whatever you want on the CLI. If you need something from before, just clone the before snapshot and extract what you need.
How would I clone an older snapshot and make it a new VM? It needs to have everything the same and show up in the Proxmox UI.

You can also rollback to whatever you want, but you will lose everything from now to then. Clone helps here.
No you cant.
You have to delete the newer snapshots manually first. And I dont want to loose them. I need both: Rollback to older snapshot and keep newer ones.

Indeed cloning would be the solution, but it is not possible.
 
No you cant.
Sure I can

Code:
zfs rollback -r dataset@snapshot

Please refer to the zfs rollback manpage.

How would I clone an older snapshot and make it a new VM? It needs to have everything the same and show up in the Proxmox UI.
You clone the current VM to the destination, destroy the new dataset and clone the desired one into the name of the just dropped. You would do that similar to this after cloning VM 100 to VM 101 (from the top of my head):

Code:
zfs destroy vm-disk-101-1
zfs clone vm-disk-100-1@snapshot vm-disk-101-1
 
  • Like
Reactions: impeding8615
Sure I can
Yeah cli... I'm talking UI.

Hm okay I get it. Thanks.

But I don't consider that an satistying solution. I mean if its as easy as two commands, why don't they bother to implement it?
In the bug report they said "because it would be a maintenance mess"... I don't really feel that for such a simple script.
Especially since this is such a common and important feature.

Will build my own script then and use the cli to make clones.
 
I mean if its as easy as two commands, why don't they bother to implement it?
Because some people don't do backups and think snapshots are a valid backup alternative so the keep hundreds of backups over years. Then they do a rollback to a year old snapshot, thinking the could reverse it to a current state later or freely jumping back and forth between the snapshots, like they could with qcow2 snapshots, and then realize all data from the last year is lost...

So it's probably more a security feature to prvent massive dataloss...
 
Because some people don't do backups and think snapshots are a valid backup alternative so the keep hundreds of backups over years. Then they do a rollback to a year old snapshot, thinking the could reverse it to a current state later or freely jumping back and forth between the snapshots, like they could with qcow2 snapshots, and then realize all data from the last year is lost...

So it's probably more a security feature to prvent massive dataloss...
Yes. IIRC, there was a time when this was possible in the beginning of the ZFS integration, yet I could be wrong.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!