Once a Proxmox VE cluster is created, its name is fixed. In the Proxmox VE Web management interface, there is no menu or button to modify the cluster name (only options to change the virtual machine name were found). In the host system Debian, the tool for managing the Proxmox VE cluster is pvecm, which also does not have an option to modify the cluster name.
Sometimes, you may find the cluster name inappropriate and want to change it, especially when the Proxmox VE cluster has already deployed many virtual machines and applications. Can the cluster name be changed? Definitely!
Start the renaming attempt
If it’s a production cluster, be cautious with renaming. After experimenting multiple times, it’s best to follow the steps carefully.
Without further ado, log in to any node’s host system in the Proxmox VE cluster, and execute the following command to confirm the current cluster name (you can also view it in the Proxmox VE Web management interface).
pvecm status
Now, I plan to change the cluster name from “sery” to “formyz.” Using the current cluster name “sery” as a keyword, I searched in the host system Debian using the following command:
grep sery /etc -r
Three files containing the cluster name keyword “sery” were found, as shown in the image.
In fact, there are two files containing the name because the content of `/etc/pve/corosync.conf` is synchronized. Following the search order, first, try to modify the file “/etc/pve/.members.” Using an editor or tools like sed to modify it fails because it is a read-only file, and even chmod to change permissions doesn’t work. This way is not feasible.
Next, consider the second file “/etc/pve/corosync.conf.” Without stopping the service, directly edit it. The modified text is shown in the image.
After saving the changes, switch to other nodes in the cluster and check if the corresponding corosync.conf file has also changed. Normally, it should synchronize. Switch to the Proxmox VE Web management interface and refresh the browser page. If nothing changes, it’s okay, but there is a fear of cluster crash.
Fortunately, the situation is fine. Although the cluster name didn’t change, no unexpected incidents occurred!
Switch to any node’s host system Debian, and stop the cluster service on that node with the following command:
systemctl stop pve-cluster
After a proper stop, there will be a red cross in the cluster Web management interface.
Then check the read-only file “/etc/pve/.members,” which has disappeared, making it impossible to change! Thinking of the relationship with Proxmox VE’s pmxcfs.
Pmxcfs is significantly related to this, execute the following command to switch the cluster to local mode.
pmxcfs -l
Try to restart the cluster service on that node, and the file “/etc/pve/.members” reappears, and its content changes.
Quickly switch to the Proxmox VE Web management interface, refresh the browser page, and it’s successful!
Summary of experience
Steps:
1. Modify the synchronized configuration file “/etc/pve/corosync.conf.”
2. Stop the cluster service pve-cluster.
3. Switch the cluster mode to local mode.
4. Restart the cluster service pve-cluster.
5. Repeat steps 2-4 on other nodes until the number of nodes satisfies the voting requirement.
Impacts:
The node on which the operation is performed, along with the virtual machines or containers running on it, may experience migration and restart. For important systems, it’s best to perform manual backups of the virtual machines or containers before operation.
Leave a Reply