Skip to content

Proxmox - Locked VM ID

If you cannot deply VMs on specific vmid's you may need to clean up old orphaned links.

Notes

Typically, you will need to investigate accross the entire cluster to find where the orphaned links still exist.

Replace <VMID> with the problem VM id You can use oxide -p '<YOUR COMMAND>' to execute these accross the cluster. BE MINDFUL**

Config files

Search for locked config files (on all cluster nodes)

ls /etc/pve/qemu-server/ | grep <VMID>

If any are found DOUBLE CHECK that the VMID is not listed in the UI. If it is not meant to be there you can delete it with

rm -f /etc/pve/qemu-server/<VMID>.conf

Logical Volumes (LVM)

There may be some orphaned logical volume references to the disks.

lvs | grep <VMID>
If there is any output, it will contain something like vm-<VMID>-disk-0 (please make a note of this ).

You can now use this output to remove the lvs volume/s on any nodes where it exists.

You will need the volume group's name, where the logical volume resides next.

vgdisplay
#or
vgs

You can now remove the volume with

lvremove /dev/<VG-NAME>/<LV-NAME>

Device Mapper

There may be orphaned references to the volume in the device mapper conf.

dmsetup ls | grep <VMID>

If there is any output, take a note of it <MAPPER_NAME>, as it will need to be remove from the dm config.

dmsetup remove /dev/mapper/<MAPPER_NAME>

Notes

If none of this works, you can ask ChatGPT or Google or something....