Proxmox - Change Node IP
Introduction
Here, we will change the IP of one node of a Proxmox VE cluster.
Moving all your VMs to another node before proceeding would be best.
Step 1 - Preparing
Go to the node you wish to change the IP. Here, we will start by listing the nodes present:
1
pvecm status
The output should show all the nodes connected to the cluster and some quorum information. Here is an example:
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
31
root@node01:~# pvecm status
Cluster information
-------------------
Name: Test-Cluster
Config Version: 5
Transport: knet
Secure auth: on
Quorum information
------------------
Date: Mon Jan 8 19:40:33 2024
Quorum provider: corosync_votequorum
Nodes: 3
Node ID: 0x00000001
Ring ID: 1.1418
Quorate: Yes
Votequorum information
----------------------
Expected votes: 3
Highest expected: 3
Total votes: 3
Quorum: 2
Flags: Quorate
Membership information
----------------------
Nodeid Votes Name
0x00000001 1 192.168.10.1 (local)
0x00000003 1 192.168.10.2
0x00000004 1 192.168.10.3
We want to change the IP 192.168.10.1
to 172.16.200.1
.
This is done one the node you want to change the IP.
Edit the file /etc/pve/corosync.conf
.You must change the node IP
and increase the config_version
inside the totem
.
Before editing:
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
31
32
33
34
35
36
37
38
39
40
41
logging {
debug: off
to_syslog: yes
}
nodelist {
node {
name: node01
nodeid: 1
quorum_votes: 1
ring0_addr: 192.168.10.1
}
node {
name: node02
nodeid: 3
quorum_votes: 1
ring0_addr: 192.168.10.2
}
node {
name: node03
nodeid: 4
quorum_votes: 1
ring0_addr: 192.168.10.3
}
}
quorum {
provider: corosync_votequorum
}
totem {
cluster_name: Test-Cluster
config_version: 5
interface {
linknumber: 0
}
ip_version: ipv4-6
link_mode: passive
secauth: on
version: 2
}
After editing:
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
31
32
33
34
35
36
37
38
39
40
41
logging {
debug: off
to_syslog: yes
}
nodelist {
node {
name: node01
nodeid: 1
quorum_votes: 1
ring0_addr: 172.16.200.1
}
node {
name: node02
nodeid: 3
quorum_votes: 1
ring0_addr: 192.168.10.2
}
node {
name: node03
nodeid: 4
quorum_votes: 1
ring0_addr: 192.168.10.3
}
}
quorum {
provider: corosync_votequorum
}
totem {
cluster_name: Test-Cluster
config_version: 6
interface {
linknumber: 0
}
ip_version: ipv4-6
link_mode: passive
secauth: on
version: 2
}
Changing this should push the new configuration to all other nodes on the cluster. Please check if this is true.
Step 2 - Change the IP
Now that the cluster knows that the IP of this node will change, we can go ahead and change it. For this, edit the file /etc/network/interfaces
and the file /etc/hosts
and change the IP to the new IP.
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
31
32
33
34
35
36
37
38
39
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!
auto lo
iface lo inet loopback
iface eno1np0 inet manual
iface eno2np1 inet manual
iface eno3 inet manual
iface eno4 inet manual
auto vmbr0
iface vmbr0 inet static
address 172.16.200.1/16
gateway 172.16.0.1
bridge-ports eno1np0
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4094
#SERVERS
auto vmbr1
iface vmbr1 inet manual
bridge-ports eno1np0.329
bridge-stp off
bridge-fd 0
#DMZ
1
2
3
4
5
6
7
8
9
10
11
127.0.0.1 localhost.localdomain localhost
172.16.200.1 node01.int.local node01
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
You can also do this in the GUI.
Step 3 - Restart services
To apply changes, restarting all the services involved is required. We will start with restarting the networking service:
1
systemctl restart networking.service
Note that you will lose remote access to your machine here. Log back in using the new IP.
Now you should see the other nodes disconnected, or if you run the command pvecm status
again, you should get only your node with the old IP.
You must restart corosync
and pve-cluster
:
1
systemctl restart corosync.service && systemctl restart pve-cluster.service
To finish this change, access each node from your cluster and run the restart corosync
.
Conclusion
In conclusion, changing the IP address of a Proxmox VE cluster node involves a systematic process to ensure a seamless transition.
The IP change is executed by editing the /etc/pve/corosync.conf
file, adjusting the node IP and increasing the config_version
within the totem
configuration. This modification triggers the new configuration’s propagation to all other cluster nodes. Subsequently, the node’s network configuration files, namely /etc/network/interfaces
and /etc/hosts
, are updated with the new IP.
After these changes, multiple services require restart, beginning with the networking service. This action may temporarily disrupt remote access to the machine. Finally, corosync and pve-cluster services are restarted to complete the IP address transition.
By following these steps meticulously, the Proxmox VE cluster ensures a smooth and coordinated update of the node’s IP address, maintaining the integrity and connectivity of the entire cluster.