32
In case you run Proxmox and realize that you would like to change the hostname, for example when about to join two nodes together into a cluster, you can proceed in the following way:
- Run ‘
hostnamectl
’ to see what you have set at the moment. - Rename it in the following files:
/etc/hostname /etc/hosts /etc/postfix/main.cf
- Then rename it in active by running ‘
hostnamectl set-hostname your-node-name
’ - Verify that it is set correctly by running ‘
hostnamectl
’ - Restart these proxmox-related services:
systemctl restart pvedaemon systemctl restart pvestatd systemctl restart pveproxy
- In case you open your node’s web interface at this point, you will notice that the old node is still there with its VMs in an unknown state. You will need to move files from one pve to another. Let’s say we renamed it from ‘node1’ to ‘proxmox1’. You would need to run the following:
# Modify these lines to your own hostnames! # From node1 to proxmox1: mv /etc/pve/nodes/node1/lxc /etc/pve/nodes/proxmox1/lxc mv /etc/pve/nodes/node1/qemu-server /etc/pve/nodes/proxmox1/qemu-server
The above will move information about all the containers and VMs onto the new node name. It is recommended to do a reboot of the node afterwards.