Rename a Proxmox node #
Introduction #
Changing the hostname of a conventional Linux machine is pretty straightforward: Change the name in /etc/hosts and /etc/hostname, reboot, and you’re done.
If the host is a Proxmox node, the process is a little more complicated. In addition to /etc/hosts and /etc/hostname, you must update the names of a few directories used to store configuration and data for the node. If the node is in a cluster, you’ll also need to update your Corosync configuration or risk bringing your entire cluster down.
This page has instructions for both renaming a standalone node and renaming a node in a cluster.
Instructions #
Rename a standalone node #
-
Access the node’s console via SSH or the Proxmox web GUI.
-
If needed, log in as root:
$ sudo su -
Update the hostname in
/etc/hostsand/etc/hostname. -
Create a new directory for time series data related to the node:
$ mkdir /var/lib/rrdcached/db/pve2-node/<new-name> $ cp -p /var/lib/rrdcached/db/pve2-node/<old-name> /var/lib/rrdcached/db/pve2-node/<new-name> -
Create a new directory for time series data related to the node’s storage:
$ mkdir /var/lib/rrdcached/db/pve2-storage/<new-name> $ cp -p /var/lib/rrdcached/db/pve2-storage/<old-name>/* /var/lib/rrdcached/db/pve2-storage/<new-name> -
Create a new directory for
qemu-serverconfig files:$ mkdir -p /etc/pve/nodes/<new-name>/qemu-server $ mv /etc/pve/nodes/<old-name>/qemu-server/* /etc/pve/nodes/<new-name>/qemu-server -
Remove the directories that reflect the old node name:
$ rm -Rf /etc/pve/nodes/<old-name> $ rm -Rf /var/lib/rrdcached/db/pve2-node/<old-name> $ rm -Rf /var/lib/rrdcached/db/pve2-storage/<old-name> -
Reboot the node:
$ reboot
Rename a node in a cluster #
If your node is in an active cluster, you’ll also have to stop Corosync, force pmxcfs into local mode, and update the Corosync configuration.
-
Follow steps one through seven of Rename a standalone node.
-
Stop the cluster and force local mode so you can update the cluster configuration:
$ systemctl stop pve-cluster $ systemctl stop corosync $ pmxcfs -l -
Create a copy of
corosync.conf:$ cp /etc/pve/corosync.conf /etc/pve/corosync.conf.new -
Update the following in
/etc/pve/corosync.conf.new:- The node’s name
- The
config_version, incrementing it by 1
-
Create another copy of
corosync.confas a backup:$ cp /etc/pve/corosync.conf /etc/pve/corosync.conf.bak -
Restart the cluster:
$ killall pmxcfs $ systemctl start pve-cluster