Modify PVE VM ID

If we want to modify PVE VM ID, the following steps would be helpful.

Steps

  • Close the VM that you want to change ID
  • Open Terminal and ssh to PVE
  • Change directory into /etc/pve/nodes/
  • Get into node directory, which name is PVE node name
  • Get into qemu-server directory, if you are changing LXC container id, go to lxc directory
  • Rename the original configuration file to destination ID
  • Edit this configuration file and modify disk file path. Two places totally
  • Edit the configuration file and modify the directory where the disk file is stored (2 in total)
  • Change directory into /var/lib/vz/images
  • Rename the directory to destination ID
  • Rename disk file to destinationo ID
  • Refresh web page, and start VM

Reference