[SOLVED] Storage "Max Backups" option doesn't have any affect

TheFuzzyFish

Member
Feb 20, 2018
17
0
6
25
I run nightly KVM backups to an offsite NFS share that I have configured directly as a Proxmox storage, but I unfortunately only have space for a limited number of backups, so naturally I have the storage "Max Backups" option set to 3. Checked back a few (5) days later to find the storage almost completely overflowing with 5 backups per VM.

As I'm writing this, it occurs to me that one of my hook scripts may be interfering the vzdump's "old backup removal" logic, because I rename the backups to include their VM hostname (follows the format "vzdump-qemu-${vmid}-${date}.${hostname}.vma.zst").
So I guess my question now is: does vzdump use the filenames to determine which backups to delete in a "max backup" situation? If not, then where could I start troubleshooting to find the source of this issue? The backup log itself didn't have any useful information.

(As of making this realization, I've edited my hook script to keep the original filenames, but I think having the hostname in the backups' filenames is a pretty handy way to tell what it is at a glance if you have 10+ VMs)
 
does vzdump use the filenames to determine which backups to delete in a "max backup" situation?
The names of the backups are relevant in a lot of places in Proxmox VE and changing them might lead to exactly the problem yours.
You can find a relevant enhancement request in our bugzilla and you can verify that with unchanged filenames the maxfiles parameter works by running vzdump manually two or three times.

You'll get something like
Code:
mala# vzdump 103 --storage nfs
INFO: starting new backup job: vzdump 103 --storage nfs
(...)
INFO: delete old backup '/mnt/pve/nfs/dump/vzdump-lxc-103-2020_03_21-00_00_05.tar.lzo'
INFO: Finished Backup of VM 103 (00:00:11)
INFO: Backup finished at 2020-06-30 09:36:14
INFO: Backup job finished successfully
mala# vzdump 103 --storage nfs --remove 0
INFO: starting new backup job: vzdump 103 --storage nfs --remove 0
ERROR: Backup of VM 103 failed - There is a max backup limit of (1) enforced by the target storage or the vzdump parameters. Either increase the limit or delete old backup(s).
INFO: Failed at 2020-06-30 09:36:39
INFO: Backup job finished with errors
job errors
 

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!