Feature request: Automated snapshots

tamis

New Member
Apr 18, 2025
4
0
1
Proxmox would really benefit from automated snapshots for containers and virtual machines. Right now it's possible to make snapshots manually. However problems can arise where for example something is unknowingly deleted and one finds out a few days later. In this case being able to restore an old snapshot recover files is beneficial. Of course this is not the same as a full backup but this is still use full. The following features would be nice to have:

1. Able to set the snapshot label
2. Able to set the snapshot frequency
3. Able to set the retention policy (max number of snapshots, expiry date)
 
I do this with frequent backups (that are automatically deduplicated and which are regularly copied to other off-site systems using Proxmox Backup Server). Why do you want to want to use snapshots instead of backups (which support file-based restores and live restore, which can start the VM/CT before the restore is finished)?
 
  • Like
Reactions: UdoB and janus57
Proxmox would really benefit from automated snapshots
Yes!

Meanwhile there are several external scripts helping to do so. Search for "cv4pve-autosnap" which is my personal favorite.

PS: bugs and feature requests may also be placed at https://bugzilla.proxmox.com/
 
I do this with frequent backups ...
Why do you want to want to use snapshots instead of backups
While I am basically with you, for me there are some reasons:
  • snapshots are technically cheap, very cheap
  • snapshots are quick, the are created basically instantaneous (on disk level, without RAM)
  • snapshots are created locally - no LAN traffic involved
  • a re-activation ("rollback") is extremely quick and it is "atomic" = there is zero risk to get interrupted
On the other hand:
  • backups (even with uptodate/active dirty-bitmap) take a while
  • backups introduce some traffic on my LAN; connectivity is required
  • only half of my VMs is up and running usually; all the other ones would trigger a full backup - initiating a lot of load on the source
  • even with "life-restore" (which is a great feature!) a restore needs some time
  • life-restore adds some risks: until it is has finished errors would damage the current "in-flight" state
  • at least in a home lab a PBS may be based on rotating rust - and restore may be really slow
Of course the technical implementation is relevant, my assumptions:
  • the above is for ZFS only, maybe other storage types behave differently
  • backup destination is always a PBS
  • I am talking about some home labs; in an Enterprise with "everything SSD" and "above 10 GBit/s" things may look differently
And no, snapshots do never count as a backup :-)

Personally I do both, of course: some snapshots and a lot of backups on several independent PBS' :-)
 
Hi,

In our enterprise the use case for snapshots is to restore a VM if an update failed, otherwise we only use backup with a PBS.


Further explanation :
Like @UdoB said snapshot is faster than backup (even with RAM included)., so before an upgrade (upgrade of application OR services OR operating system) we like to use a snapshot because it is quicker to rollback in case of failure or any other issues and obtain the lowest possible interruption of services for the customer.

But for any other situation like a file deleted the only solution we see is to use backup, because we cannot interrupt a customer just to do a rollback of snapshots to get missing files where we can just the file restore functionality of PBS, especially when the customer says that the file was present 10 days ago (or even more, some customer wanted a file that was present 2 years ago..).

Best regards,
 
  • Like
Reactions: UdoB
With a loop mount (.raw; qcow2 with additional steps) you get access for fast separat file/dir life-restores out of snapshots as we do so already.
 
Last edited:
you can use zfs-auto-snapshot too:
Code:
 apt install zfs-auto-snapshot
Then you must setup the zfs dataset, so it can use it:
Code:
zfs get com.sun:auto-snapshot <zfs-dataset>
zfs set com.sun:auto-snapshot=[false,true] <zfs-dataset>
 
Last edited: