It is possible to edit the ID of a node?

Sagitario

New Member
Nov 21, 2015
3
0
1
sd.png
Look this image, I want to change the ID 0 to 1 or 2 for example.
Would anyone know how?
Greatss!!
 
Upfront question, why? :D

So to answer your question we have do differ between to cases:

*) Single node - no cluster configured: no, here we give back 0 as there is simply no reason to another value. If you do not want to change the code then no, there is no possibility.

*) Cluster:
The node id is used and given by corosync, so yes you can change it in a cluster, simply edit the /etc/pve/corosync.conf file and change the respective nodeid.
Maybe do a reboot of said node after that and then your done.

But it does not give you any features or anything and I don't know if it has bad side effects (I suppose not but never really thought about it)
 
Last edited:
  • Like
Reactions: jsterr
Upfront question, why? :D

So to answer your question we have do differ between to cases:

*) Single node - no cluster configured: no, here we give back 0 as there is simply no reason to another value. If you do not want to change the code then no, there is no possibility.

*) Cluster:
The node id is used and given by corosync, so yes you can change it in a cluster, simply edit the /etc/pve/corosync.conf file and change the respective nodeid.
Maybe do a reboot of said node after that and then your done.

But it does not give you any features or anything and I don't know if it has bad side effects (I suppose not but never really thought about it)
Tried to do the 2nd step, for the cluster -
Code:
 systemctl stop pve-cluster corosync.service
## Edited and changed Cluster's Node ID
vi /etc/corosync/corosync.conf    
pmxcfs -l
## Edited and changed Cluster's Node ID
vi /etc/pve/corosync.conf
killall pmxcfs
systemctl start pve-cluster.service corosync.service

But then come's the following error - "hostname lookup 'pve4' failed - failed to get address info for: pve4: Temporary failure in name resolution (500)"

Edit: I have did the same thing on the host and the node itself, then the issue got fixed!
 
Last edited:
But then come's the following error - "hostname lookup 'pve4' failed - failed to get address info for: pve4: Temporary failure in name resolution (500)"

Edit: I have did the same thing on the host and the node itself, then the issue got fixed!

You changed more than IDs. Also, you edited 2 instances of the file, the /etc/pve one would have distributed your change for you to the other nodes (if you had not changed hostname).
 
  • Like
Reactions: robxcalib3r
For future reference:
- Make sure you have a quorate cluster.
- Without shutting down any services, on one node adjust /etc/pve/corosync.conf with the nodes ID's as desired (can be changed all at once). Make sure to also increase the config version +1.
- Saving the updated config file will propagate it to the other nodes.
- Restart the corosync service on the node on which you edited the config file first. This starts the cluster with the new node ID's.
- The other nodes will join after you restart the corosync service on those as well.