What is the max VM ID?

tessus

Active Member
Oct 5, 2020
41
4
28
Toronto, Canada
I checked the documentation and searched the Net, but couldn't find an answer.

What is the max value of a VM ID?

In the man pages I could see that it is an integer: <vmid> <integer> (1 - N)
Is it a 32-bit integer? Unsigned?. 64bit?

Even if it's just a 32bit int, it would mean that N could be 2147483647.

This is usually not important, but I'd like to start using a certain format, e.g. TVVVVONUUUU

where T is a type (template, VM, LXC) and used so that the next 4 can be padded, since I can't have leading zeros.
VVVV is the VLAN ID
O is the OS type
N network type statIc/dhcp
UUUU VM number

I can't do that when the max VMID is e.g. 9999.
 
Its a valid question to get an officially supported number. You can also just give it a try :-)

Code:
root@pve7test1:~# qm create 123456789
root@pve7test1:~# qm list
      VMID NAME                 STATUS     MEM(MB)    BOOTDISK(GB) PID       
 123456789 VM 123456789         stopped    512                0.00 0         
root@pve7test1:~# qm create 123456789123456789
400 Parameter verification failed.
vmid: invalid format - value does not look like a valid VM ID

qm create <vmid> [OPTIONS]
root@pve7test1:~# qm create 12345678912345678
400 Parameter verification failed.
vmid: invalid format - value does not look like a valid VM ID

qm create <vmid> [OPTIONS]
root@pve7test1:~# qm create 1234567891234567
400 Parameter verification failed.
vmid: invalid format - value does not look like a valid VM ID

qm create <vmid> [OPTIONS]
root@pve7test1:~# qm create 123456789123456
400 Parameter verification failed.
vmid: invalid format - value does not look like a valid VM ID

qm create <vmid> [OPTIONS]
root@pve7test1:~# qm create 12345678912345
400 Parameter verification failed.
vmid: invalid format - value does not look like a valid VM ID

qm create <vmid> [OPTIONS]
root@pve7test1:~# qm create 1234567891234
400 Parameter verification failed.
vmid: invalid format - value does not look like a valid VM ID

qm create <vmid> [OPTIONS]
root@pve7test1:~# qm create 123456789123
400 Parameter verification failed.
vmid: invalid format - value does not look like a valid VM ID

qm create <vmid> [OPTIONS]
root@pve7test1:~# qm create 12345678912
400 Parameter verification failed.
vmid: invalid format - value does not look like a valid VM ID

qm create <vmid> [OPTIONS]
root@pve7test1:~# qm create 1234567891
400 Parameter verification failed.
vmid: invalid format - value does not look like a valid VM ID

qm create <vmid> [OPTIONS]
root@pve7test1:~# qm create 123456789
unable to create VM 123456789 - VM 123456789 already exists on node 'pve7test1'
 
  • Like
Reactions: yyy123
Thanks a bunch for your reply. Your test confirmed it's either a 32bit (signed or unsigned) integer. Signed or unsigned doesn't matter much in this case, since the number of digits won't change. But I will have to adjust my format.

And yes, I could have tried. Stupid me, sometimes the obvious solution escapes me.
 
  • Like
Reactions: UdoB and nfisher