Skip to content

Instantly share code, notes, and snippets.

@th3gundy
Created April 20, 2022 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save th3gundy/0ebc449529f5b8bdeda15efa148deb35 to your computer and use it in GitHub Desktop.
Save th3gundy/0ebc449529f5b8bdeda15efa148deb35 to your computer and use it in GitHub Desktop.
Proxmox change virtual machine ID
oldVMID=111
newVMID=999
# change node name with yours
sed -i "s/$oldVMID/$newVMID/g" /etc/pve/nodes/security/qemu-server/$oldVMID.conf
mv /etc/pve/nodes/security/qemu-server/$oldVMID.conf /etc/pve/nodes/security/qemu-server/$newVMID.conf
mv /vm-storage/images/$oldVMID/ /vm-storage/images/$newVMID/
cd /vm-storage/images/$newVMID/
ls
# change id in disk name
mv vm-$oldVMID-disk-0.qcow2 vm-$newVMID-disk-0.qcow2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment