What is a suitable unique id for VMs accross nodes and clusters.

medchiheb

New Member
Aug 16, 2023
3
1
3
Hey,

I'm working on automating kubernetes Bootstrapping on Proxmox with implenting a cluster api provider, that can work for typical Proxmox installations.

I do not have much knowledge of Proxmox.

I would like to ask What would be the best unique Id for VMs accros nodes and clusters if possible.


I'm planing for format it like this `proxmox://{node}/{vmid}` , but then i remember the HA setup.
and actually, i'm against formating it like this `proxmox://{cluster}/{node}/{vmid}`

So, is there any suggestions for a unique id for VMs?

Is `smbios1` uuid identified as a unique id in whole proxmox setup? accross nodes and potentially clusters?


I would really appreciate your feedback.
 
I would like to ask What would be the best unique Id for VMs accros nodes and clusters if possible.
Its unclear what is the purpose of this unique ID and where/how it will be queried/stored. Is this for external app to drive things?
You could utilize TAGs on VM and come with your own site unique ID structure that would mean something to you (rack,cluster,node,etc).


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
The unique id will be used to identify the machines in proxmox.

For instance.
The capi provider should provide a unique ID.
And then those IDs must match the kubernetes Node ID so they can be intialized ,
This a cluster api term.

However, i want to know if the bios uuid can be used in this case.

Cause the bios uuid is easy to fetch for this case.

I wonder if It’s unique accros nodes or in a HA setup.
 
I wonder if It’s unique accros nodes or in a HA setup.
Lets find out:
Code:
qm config 3000|grep uui
smbios1: uuid=e0920afc-99af-414b-a61c-e4f3ba10868d

 grep -R smbios1 /usr/share/perl5/PVE
 /usr/share/perl5/PVE/API2/Qemu.pm:    'smbios1' => 1,
/usr/share/perl5/PVE/API2/Qemu.pm:                  # auto generate uuid if user did not specify smbios1 option
/usr/share/perl5/PVE/API2/Qemu.pm:                  if (!$conf->{smbios1}) {
/usr/share/perl5/PVE/API2/Qemu.pm:                      $conf->{smbios1} = PVE::QemuServer::generate_smbios1_uuid();

grep -R generate_smbios1_uuid /usr/share/perl5/PVE
//usr/share/perl5/PVE/QemuServer.pm:sub generate_smbios1_uuid {

grep -A2 -B2 -R generate_smbios1_uuid /usr/share/perl5/PVE/QemuServer.pm
}

sub generate_smbios1_uuid {
    return "uuid=".generate_uuid();
}

grep -A2 -B2 -R "sub generate_uuid" /usr/share/perl5/PVE/QemuServer.pm
}

sub generate_uuid {
    my ($uuid, $uuid_str);
    UUID::generate($uuid);

Keep following the code and decide if its unique enough for your purposes



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!