zfs rollback not deleting snapshots from GUI (and GUI won't delete the ghosts)

ronejamesdo

Member
Apr 22, 2024
43
5
8
I was trying out zfs clone (to see about navigating around zfs snapshots in a non-linear fashion).

Following some directions online I ended with "zfs rollback -r BigDrive/vm-101-disk-0@SN-2024-05-02-1047am" which was to rollback to the snapshot in question and delete the intermittent ones. This looks to have worked at the command line:

zfs list -t snapshot | grep 101
BigDrive/vm-101-disk-0@SN-2024-05-02-1047am 0B - 6.12G -
BigDrive/vm-101-disk-0@SN-2024-05-02-1048am 0B - 6.12G -
BigDrive/vm-101-disk-0@SN-2024-05-02-1049am 0B - 6.12G -
BigDrive/vm-101-disk-0@SN-2024-05-02-1049am-p2 0B - 6.12G -
BigDrive/vm-101-disk-0@SN-2024-05-02-1053am 1.04M - 6.12G -

zfs rollback -r BigDrive/vm-101-disk-0@SN-2024-05-02-1047am

zfs list -t snapshot | grep 101
BigDrive/vm-101-disk-0@SN-2024-05-02-1047am 17.1K - 6.12G -

But in the GUI I still see:

1714675091215.png

If I try to delete a ghost I get an error that the snapshot isn't there and then it says:

1714675180325.png

If I try again on the one that's "delete" now for a timestamp I get:

1714675311344.png

Is there some way to delete these now?

Is there someway to use zfs rollback that will also remove them from the GUI?

Thanks.

RJD
 
Is there some way to delete these now?
You can probably edit the VM configuration file manually.
Is there someway to use zfs rollback that will also remove them from the GUI?
Probably not. You're messing with the storage behind Proxmox's back, much like removing the virtual disks and the VM configuration file will also no longer match reality.
 
There is also the "qm/pct rollback" command to tell PVE to rollback to a specific snapshot:
https://pve.proxmox.com/pve-docs/qm.1.html said:
qm rollback <vmid> <snapname> [OPTIONS]
Rollback VM state to specified snapshot.
<vmid>: <integer> (100 - 999999999)
The (unique) ID of the VM.
<snapname>: <string>
The name of the snapshot.
--start <boolean> (default =0)
Whether the VM should get started after rolling back successfully. (Note: VMs will be automatically started if the snapshot includes RAM.)
 
Hi,
the recommended way in such a case is using
Code:
qm unlock 101
and then
Code:
qm delsnapshot 101 <snapshot name> --force 1
for each ghost snapshot, but not the one you want to rollback to!

You can then use
Code:
qm rollback 101 SN-2024-05-02-1047am
to properly roll back the VM (as well as the configuration) to the saved state.

With ZFS you have to remove the newer snapshots before doing a rollback to an older one.
 
Thanks everyone, you gave me an idea:

If I manually edit:

/etc/pve/qemu-server/101.conf

And remove all of the lines pertaining to the now-nonexistent snapshot (they are handsomely grouped in the .conf file and so leave little chance of error) the ghosts disappear from the GUI.

Is there anything "deeper" that I need to consider inside of proxmox or is this an acceptable solution?

Also, since:

zfs rollback -r

exists, and:

qm rollback

exists, couldn't "qm rollback -r" exist?

My thinking is that if I wish to roll back to a snapshot and eliminated all of the snapshots taken after that snapshot, I have to either delete them one by one in the GUI or delete them one by one with qm at the command line. Doing the exact same thing over and over again in a specific sequence is exactly the kind of thing that computers are really good at (and humans mess up at).

Maybe like a "qm rollback -r" and a warning box in the GUI ("Rolling back with zfs will delete all intermittent snapshots, continue Y/N") would be a low-hanging-fruit type of addition?

Just thinking aloud.

Thanks.
 
If I manually edit:

/etc/pve/qemu-server/101.conf

And remove all of the lines pertaining to the now-nonexistent snapshot (they are handsomely grouped in the .conf file and so leave little chance of error) the ghosts disappear from the GUI.

Is there anything "deeper" that I need to consider inside of proxmox or is this an acceptable solution?
You'd also need to adapt the parent property of the current configuration and last remaining snapshot. If you remove the snapshots via qm delsnapshot that is taken care of for you.
Also, since:

zfs rollback -r

exists, and:

qm rollback

exists, couldn't "qm rollback -r" exist?
In principle, yes and was already requested once: https://bugzilla.proxmox.com/show_bug.cgi?id=5171
 
Thanks everyone. I have noted the "parent" dynamic and look forward to a possible "-r" for "zfs rollback".
 

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!