IP Change for Proxmox Nodes
If for some reason you need to change the IP addresses of your Proxmox nodes, removing it from the cluster sounds like the easier option. However, if you just wing it and then things go to hell, well, yeah….
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Stop the cluster services
systemctl stop pve-cluster
systemctl stop corosync
# Mount the filesystem locally
pmxcfs -l
# Edit the network interfaces file to have the new IP information
vi /etc/network/interfaces
# Replace any host entries with the new IP addresses
vi /etc/hosts
# Edit the corosync file and replace the old IPs with the new IPs for any changed hosts
# BE SURE TO INCREMENT THE config_version: x LINE BY ONE TO ENSURE THE CONFIG IS NOT OVERWRITTEN
vi /etc/pve/corosync.conf
# Edit the known hosts file to have the new IP(s)
/etc/pve/priv/known_hosts
# If you want to be granular... fix the IP in /etc/issue
vi /etc/issue
# Reboot the system to cleanly restart all the networking and services
reboot
# Referenced pages:
# - https://forum.proxmox.com/threads/change-cluster-nodes-ip-addresses.33406/
# - https://pve.proxmox.com/wiki/Cluster_Manager#_remove_a_cluster_node
While these instructions helped, and things did change. There was still some fallout. Might be due to not incrementing the corosync.conf file. This did appear until running Terraform and having it fail.
In no particular order, these following commands helped in the long run.
1
2
3
4
5
6
7
8
9
10
systemctl status pve-cluster
journalctl -b -u pve-cluster
rm -rf /etc/pve/nodes/pve###
journalctl -b -u corosync
systemctl start corosync
corosync-keygen -l -k /etc/corosync/authkey
There was a sync issue between the clusters. When attempting to join the new cluster, it wouldn’t join cause of the VMs on the machine. Backup the VMs and delete. In the datacenter, at the top of the tree, under storage, you can add network shares for the nodes to see. If the authkey was missing, generate a new one. Once there was no VMs, the nodes were able to join the cluster.
Once everything is happy again, restore your VMs from the backup.