Avoid Reuse of VMID

Sahil

Member
Jun 14, 2022
32
1
6
Hi Team,

We are facing challenges in maintaining the backup in PBS. due to the reuse of VMIDs

VMIDs should be auto-incremental, like in a database.

Currently, when you remove a VM/CT, the ID becomes available again, and the next time you create a virtual machine It will be used (proxmox will suggest the least available ID).

Example: VM id 100 is backed up in PBS and VM ID 100 is deleted from PvE after some time then you create a new VM. Pve will choose the Free id which is "100 again" So if we take the backup it overwrites the old 100vmid's data.

So we need a solution for this, it should only create the VMS in incremental Last created VMID+1. if I delete the VMid 100 it should not use the same 100 ids again in the future, instead, it should create on VMID-101.
 
See the changelog for PVE 7.2:
  • Support configuring the range that new VMIDs are selected from when creating a VM or CT.
You can set the upper and lower boundaries in the datacenter's options panel. Setting lower equal to upper disables auto-suggestion completely.
So in case multiple clusters share the same PBS you could give each cluster another non-overlapping VMID range to choose from.

And on the PBS side you could make use of the namespaces added in PBS 2.2, so each cluster is using its own namespace. That way its no problem for multiple guests using the same VMIDs and you still get the good deduplication ratio.
 
See the changelog for PVE 7.2:
I think OP's problem is unrelated to multi-cluster collision. If I understand the post correctly, OP has original VM100 that is backed up with retention=1, as an example. The VM is deleted later, but backup needs to be preserved.
A new VM is created and it is auto-assigned next available ID which is 100. On next backup the retention will cause original VM data to be discarded from PBS.

Short term solution for OP is to always specify VM ID on creation and to keep track of it outside of PVE. Another path is to move the backed up data elsewhere on VM removal if backup needs to be preserved.

@Sahil given that such functionality does not exist currently, you would need to file an enhancement request : https://forum.proxmox.com/threads/where-to-post-feature-requests.46317/


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Last edited:
Silimar problem is when you create permission to user for particular VMID. This remains valid after you delete server and that user has access to completely different server when the VMID is reused :(

Not to mention that we are trying to pair VMID to billing to another system and it creates problems with duplicate entries.
 
Not to mention that we are trying to pair VMID to billing to another system and it creates problems with duplicate entries.
already answered you in the bug report as well - but this reallyyyy sounds like you need something on top of PVE that does that integration and tracking for you..
 

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!