[SOLVED] Pruning: What happens when removing a VM and later creating a new one with the same ID

Cookiefamily

Well-Known Member
Jan 29, 2020
136
40
48
Germany
Hello,

let's start with the following scenario:
I created a VM with Windows and ID 110. The VM is backuped by PBS with a pruning of keep-daily=7. I no longer need this VM and decide to delete it. When deleting the backup does not automatically get deleted as well.

Question 1: If I waited 7 days, would it delete all snapshots? Or would it keep them indefinitly until I manually remove them?

Question 2: Three days later I create a new Linux VM that recieves ID 110. Because there are still snapshots of the Windows VM left, the incremental Backup will probably be rather large. Does the first "Full" eventually get pruned or will the Windows files stay there for eternity and consume space? (Assuming I don't have any other Windows VMs where it would probably get deduplicated a lot)
 
Hi,
Question 1: If I waited 7 days, would it delete all snapshots? Or would it keep them indefinitly until I manually remove them?

It would not remove them, as you instructed it to keep the (last) 7 daily backups available.
So yes, removal would only happen with a manual forget, or when altering the prune settings.

Question 2: Three days later I create a new Linux VM that recieves ID 110. Because there are still snapshots of the Windows VM left, the incremental Backup will probably be rather large. Does the first "Full" eventually get pruned or will the Windows files stay there for eternity and consume space? (Assuming I don't have any other Windows VMs where it would probably get deduplicated a lot)

Assuming you still had the keep last 7 daily prune setting, the backups of the old Windows VM would move out of the keep scheduling with each new daily backup of the new Linux VM, which VMID it shared.
So, once you have 7 days of Linux VM backups made, all Windows ones would be pruned.
A Garbage Collection run would then free all data chunks which were only used by backups snapshots from this, now gone, Windows VM.
 
  • Like
Reactions: Cookiefamily
Hello @t.lamprecht ,

I'd like to add/confirm something with regards to this question.

I thought that the first new backup for a VMID would be full and subsequent backups would be incremental. So if a windows VM was deleted and 3 days later a Linux VM was created using the now freed up VMID previously used by the decommissioned windows VM, when will a full first backup occur for this new Linux VM if PBS doesn't know it's a new VM?

Or have I misunderstood the first full backup for each VMID?

Thank you.
 
How I understand it:
The first backup kinda has to be a full backup, that makes sense. But the incrementals aren’t your traditional incrementals where the first „state“ of the VM never changes. PBS just keeps the chunks it needs for the last X days you specified. If you reached the prune threshold for your last backup with Windows on this VMID, it will go ahead and check, what chunks are still needed, figure out that that’s basically none and forget about them.
A bit smarter than traditional incrementals...
 
It would not remove them, as you instructed it to keep the (last) 7 daily backups available.
So yes, removal would only happen with a manual forget, or when altering the prune settings.

It's worth mentioning that the "more/remove" dialog in the PRX GUI has a checkbox that is misleading when using PBS.
I understand why its there and what it does for legacy dumps- but that is not the case when using PBS. It is not removing anything. I propose to make this button forget all corresponding snapshots for this VM/CT on PBS as well. Data Protection Regulation may require backups to be deleted once a VM is deleted.

firefox_BpMGyKmJUg.png
 
This purge checkbox is completely orthogonal to backups, and also has nothing directly to do with "legacy dumps", as you call it. If ticked, the VMID gets removed from various jobs like HA, replication, backup jobs, Firewall.

We will not make it purge all backups, that is highly dangerous and unexpected for most users.

Just prune it on the backup server, that's fast and easy.
 
Understood. How does one prune all snapshots for a certain group fast and easy?
"forget" only seems to prune one snapshot.
 
You can use the prune scissor action button in PBS:
pbs-prune-group.png

With that you can prune specific backup groups, if you want to remove it completely, the quickest way is to set keep-last to 1, prune, and then forget the remaining last backup.
 

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!