How to Change a VM/CT ID

E.g.: Change VM with ID 100 to ID 200

This is for cases in which you need to obey a nomenclature and wish to re-organize your VMs.

Go to the directory where the config file is:

$ cd /etc/pve/nodes/`hostname`/qemu-server/

Modify the filename

$ mv 100.conf 200.conf

Fix the disk names by changing the volume or file name

Manual Disk Rename

$ nano 200.conf

sata0:ZFSA_Pool:vm-100-disk-0,size=50G

to

sata0:ZFSA_Pool:vm-200-disk-0,size=50G

Disk Rename With Regex

$ sed -i "s/vm-100-disk-/vm-200-disk-/g" ./200.conf