Modify VM ids Range

teicee

New Member
Dec 14, 2018
6
0
1
124
It would be a good idea to be able to modify the range of IDs that a VM can take.

I see that the range is fixed in code (/usr/share/perl5/PVE/API2/Cluster.pm) :
Perl:
for (my $i = 100; $i < 10000; $i++) {
            return $i if !defined($idlist->{$i});
}

Thanks
 
hi,

10000 isn't enough? what's your use case?
 
I have two clusters and I want to have different VM IDs on each cluster.

two different clusters aren't dependent on each other, so you can assign the VMIDs in any way you like, e.g. 100-5000 for cluster1 and 5000-9999 for cluster2 (or however you like).
 
Hello,

Sorry for bumping old thread, but is it possible to configure default VM id range from the GUI?

cluster1 - starting from 100
cluster2 - starting from 1000

The reason why I'm asking, because we're using Proxmox Backup Server and would like to backup 2 clusters to the same machine. Having identical IDs in this scenario will cause a mess.

Thanks.
 
Hi,
as far as I know you need to keep an eye on this manual when creating VMs.
Mabye editing /usr/share/perl5/PVE/API2/Cluster.pm on one Cluster is an option. But I am unsure if this gets "overwritten" by any updates....
 
Hi, dont try to solve the backup problem, try to solve the "unique VMID" problem. So start eg VM Ids on Cluster A at 1000 and on Cluster B at 11000
Best regards,
Volker
 
Hi Volker, there's been no change in the code that would give you this functionality. There are a few approaches that you can take:

a) Manually modify the file mentioned earlier in the thread. This is not guaranteed to persist through upgrades and does not prevent user from manually specifying "offending" ID.
b) Create your own middleware that tightly controls ID assignment.
c) Take a look at ModulesGarden. If they don't have this already, they may be willing to implement it for you on mutually beneficial terms.
c) Create and submit a patch that implements a mechanism similar to "Mac Address Prefix" option at Datacenter level

Аs @oguz mentioned exactly two years ago - the Proxmox clusters are normally independent of each other. Perhaps it makes sense to review why a clashing ID is causing conflicts in your environment.



Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 

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!