Disk UUID on cloned/template VMs

jmjosebest

Renowned Member
Jan 16, 2009
192
37
93
Hello, we have automated the installation of new KVM type VMs with the templates.

The problem we see that all disks of different VMs have the same UUID.

In principle this has never been a problem for us, but I would like to correct it.

The approach I have is:

- With the VM off
- Generate a new UUID at node level.
- Assign that UUID to the VM disk/partition
- Mount the VM partition on the node.
- Edit the VM fastab modifying the UUID
- Unmount the partition
- Boot the VM

It doesn't seem to me the most correct way, but I can't think of any other way.

Any idea / recommendation ?

Thanks!
 
If you really need to do this, a much easier way would be to either:
a) Change the fstab in your template to use LVM path rather than uuid. Then there is no dependency if uuid changes later.
Add a startup script that autogenerates new uuid and assigns it on first boot.
b) Create a startup script that on first boot generates uuid, updates the partition, updates the fstab, reboots the client.

Both (a) and (b) can be done with CloudInit or other host automation tools. Mounting VM partition on a host seems icky.


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!