Move nodes/vm’s after hostname change PVE

When you change the hostname of your proxmox host it can happen, that you can access the nodes and the vm’s. In the following steps is discriped how to move the vms’s to the new node.

After you changed the hostname, as described in this article. You can move the configuration files, as the pmxcfs has a few restrictions to ensure consistency you cannot rename non empty folders.

cp -r /var/lib/rrdcached/db/pve2-node/$OLDHOSTNAME/* /var/lib/rrdcached/db/pve2-node/$NEWHOSTNAME 
cp -r /var/lib/rrdcached/db/pve2-storage/$OLDHOSTNAME/* /var/lib/rrdcached/db/pve2-storage/$NEWHOSTNAME 

Make sure to remove the old directorys after this step.

Now you need to copy the configuration files of the old node to the new one

cp /root/OLDHOSTNAME/qemu-server/* /etc/pve/nodes/NEWHOSTNAME/qemu-server

After this you can reboot the server and the VM’s should now assigned to the new node.

🖤 Did this article help you?
Buy me a coffee and support my work to keep this space 🚀 and ad-free. If you can’t, share my work to reach this 📖 out to more people.

Leave a reply

Your email address will not be published. Required fields are marked *