Delete VM in PVE but preserve backups of VM in PBS

Jan 23, 2021
51
17
13
Hi all,

I would like to delete some unused VMs in PVE to free up some space. The VMs are all backed up using PBS.

If I delete the VMs will the corresponding backups in PBS be destroyed?

I've deleted VMs before but never had the desire to keep the backups around until now. Not sure exactly how this would behave given that the backups are labeled with the VM IDs. What happens if I create a new VM and one of those previous IDs is re-used?

My thinking is to delete them to free up some space now but later if I need to get them back up and running I can just create a new VM and restore the disk from the old backups, assuming this is possible.

Any help or advice would be greatly appreciated.

Thanks,

FS
 
Set the protected flag on the snapshot - that stops the prune job removing it or a manual delete.
 
OK. But what happens when a new VM re-uses one of the previous ID's? That's not clear to me.

For example, I want to delete VM 106. The backup in PBS when created is automatically labeled "vm/106/timestamp". If I delete VM 106 and then create a new VM and ID 106 is re-used, when PVE runs the backup for this new VM it will also be labeled with "vm/106/timestamp". Or will PVE know that it can't re-use that ID again somehow perhaps?

It's a bit unclear.
 
Or will PVE know that it can't re-use that ID again somehow perhaps?
No, PVE doesn't care and will use that VMID again if it isn't in use and on the PBS side then both VMs belong to the same backup group.
Until PVE is keeping track of previously used VMIDs you should do that on your own and keep a list and never assign the same VMID to multiple VMs if you don't want them to be grouped (and pruned) together in PBS.
 
Last edited:
  • Like
Reactions: Tmanok
OK. That makes sense. So at this point, it would be up to me to manage the IDs and make sure those previous ones aren't re-used. Manually assigning the ID of each new VM.

Is there no way to configure qemu on PVE to ignore/blacklist certain IDs so they wouldn't get used automatically? I've tried searching online and in the docs for something like this but have not found anything.

Thanks,

FS
 
No problem. I have deleted the VM's now. I will just make sure to manually set the ID from now on when creating a new one.

I assume the idea now is that if I do ever need to restore those VMs, I would just create new ones with the previous IDs and then the backups should show up from PBS in the backup section.
 
You don't need to create a blank VM first. Just go to your PBS storage and there you will find list of all backups, then select the backup you want and set a VMID that should be used for the restored VM.
 
  • Like
Reactions: Tmanok

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!