Limiting Proxmox SnapShots

informant

Renowned Member
Jan 31, 2012
843
12
83
Hi all, how can we set a Limit of Proxmox Snapshots, Problem is, many Users make every Day Snapshots without delete old, and Storage is full after many Weeks. We need a Option to set a Limit of Snapshots or a seperate Space what can uyed max. for Snapshots. Any Ideas here? regards
 
Problem is not that there are so many snaps. I think they are a tool and should be used whenever it makes sense.
But one by one removal is not nice for PVE admins as well as for users that created those snaps.

If we could select and remove several snapshots with one action that would help.
Maybe selection with a "since" and "until" filter like we have already for system logs...
 
  • Like
Reactions: Johannes S
you can either automate pruning snapshots, or not give users that abuse it the right to create them in the first place.
 
  • Like
Reactions: Johannes S and woma
This can create and prune snapshots: https://github.com/Corsinvest/cv4pve-autosnap
To delete manually you can use something like this which I grabbed from one of my scripts so it needs adjustments for your setup
Bash:
for snap in $(pvesh get /nodes/"$NODE"/"$TYPE"/"$GUESTID"/snapshot --output-format json | jq -r 'sort_by(.snaptime)|.[]|select(.snaptime != null)|.name'); do
    pvesh delete /nodes/"$NODE"/"$TYPE"/"$GUESTID"/snapshot/"$snap"
done
 
  • Like
Reactions: woma
Just create a rule in your monitoring service to trigger an alert if there are more than 2-3 snaps or if the snaps are older than 72h