How to Rename a Node in Proxmox

Renaming a node in Proxmox may seem simple at first, but it requires careful attention to avoid issues, especially in production environments or clusters. In this guide, we will cover the correct steps to change the server name safely.

Step 1: Change the System Hostname

First, edit the /etc/hostname file to set the new server name:

nano /etc/hostname

Replace the old name with the new one and save the file.

Next, edit the /etc/hosts file to reflect the change:

nano /etc/hosts

Modify the line corresponding to the old hostname:

127.0.1.1    new-server-name

Save and close the file.

Step 2: Rename the Node Directory in Proxmox

Proxmox stores node configurations inside /etc/pve/nodes/. Before renaming it, stop the cluster services to avoid inconsistencies:

systemctl stop pve-cluster
systemctl stop corosync

Now, check if the new name directory already exists:

ls /etc/pve/nodes/

If it already exists and contains files, make a backup before proceeding:

mv /etc/pve/nodes/new-name /root/backup-new-name

Now, rename the node directory:

mv /etc/pve/nodes/old-name/qemu-server/* /etc/pve/nodes/new-name/qemu-server/
mv /etc/pve/nodes/old-name/lxc/* /etc/pve/nodes/new-name/lxc/

If you encounter an error while moving the directory ("Directory not empty"), manually copy the files:

cp -a /etc/pve/nodes/old-name/* /etc/pve/nodes/new-name/

Additionally, move the qemu-server and lxc directories:

mv /etc/pve/nodes/old-name/qemu-server /etc/pve/nodes/new-name/
mv /etc/pve/nodes/old-name/lxc /etc/pve/nodes/new-name/

Step 3: Restart Proxmox Services

After renaming, restart the services so that Proxmox recognizes the changes:

systemctl start pve-cluster
systemctl start corosync
systemctl restart pvedaemon
systemctl restart pveproxy
systemctl restart pvestatd

If Proxmox is running in a cluster, you may need to update the node certificates:

pvecm updatecerts -f

Step 4: Verify the Configurations

To confirm that the name has been changed correctly, run:

hostnamectl
ls /etc/pve/nodes/

If everything is correct, the new node name should appear.

Conclusion

Renaming a node in Proxmox requires some precautions to ensure all configurations are correctly adjusted. If working in a production or cluster environment, always create backups before making any changes. By following this guide, you can safely rename your node without affecting the platform's functionality.