Remove one from the cluster, then wipe it and reinstall a clean Proxmox with the new name and new IP-address, and add it to the cluster. Do the same for the other node. Please note that a two-node cluster does work when one of the nodes is missing if there is no Q-device (or third vote).I would like to rename these nodes (currently "proxmox" and "joanine"). What is the correct way of doing this?
I don't fully understand the question. Nodes should be empty when adding to a cluster, but can't you migrate the VMs/CTs between the current nodes? And if you rename in-place, I don't see why. It's always wise to make backups of the VMs/CTs before making changed to the cluster (which you can restore later).Thanks, it sounds like I cannot keep my current VMs/containers if I want to rename the host. Is that correct (must be "empty")?
See the wiki linked above:I would just like to change the names of the physical machines.
This must be done on a empty node.
So you then have to remove all the VMs/LXCs on the node you want to rename.If your node is in a cluster, where it is not recommended changing its name
@What's all with the fuss changing name of a node in a cluster? I did not the first time and everything is working with no issue. Or am i missing something here? Would be happy to learn my mistake. So here is what i did:
My setup: 2 node cluster with a qdevice.
1. I migrated all the vm and lxc out of the node I want to rename (no backup no mercy)
2. ssh into the node i want to rename
3 updated /etc/hosts and /etc/hostname
4. updated /etc/pve/corosync.conf (do not foget to increment the version)
5. went to /etc/pve/nodes and deleted the old node name
6. updated ssh key pub
7. rebooted
I do not see any errors and cluster is fine. Mirgration works and everything.
NOTE: If you have replication setup the replication does not work anymore as it cannot find the old node anymore. So you have to recreate the replication with the new node name. In case you have replication setup, the old replication does not get deleted automatically (at least in my case). But you can delete it manually from /etc/pve/replication.cfg
6. I'm not completely sure, but i think it may be this steps:@
homelabenthusiast
I want to rename hostname one of my node name in a cluster where I have total 3 nodes; testnode, prox2, prox3; I want to change testnode name to prox1, but it had some VMs, I have migrated them to other nodes
I just wanted to understand, what did you mean by
4. updated /etc/pve/corosync.conf (do not foget to increment the version) [an example?]
6. updated ssh key pub [how to do that?]
Why does it matter if there are VMs on it? Just move them to another node. That is the whole point of having a cluster, at least what a cluster in PVE is about.These are the steps I took to change a hostname of a node which is a member of a cluster already, and have some VMs as well
Thanks this worked perfectly!Thanks @microreal , special thanks to @homelabenthusiast
These are the steps I took to change a hostname of a node which is a member of a cluster already, and have some VMs as well. Now I don't really understand if all of these commands are necessary, I just collected some resources and made a list of my own which I thought will help, and it did work.
- Stopped all VMs [ Also Moved all important VM to another Node for my peace of mind]
- From the node terminal which I want to rename, I ran these and made changes for new_hostname
- cp -r /etc/pve /root/pve_backup
- nano /etc/hosts
- nano /etc/hostname
- nano /etc/mailname
- nano /etc/postfix/main.cf
- hostnamectl set-hostname new_hostname
- nano /etc/pve/corosync.conf (increased the config_version from 3 to 4, the version maybe different from user to user)
- pvecm updatecerts
- systemctl restart pveproxy
- systemctl restart pvedaemon
- cd /etc/pve/nodes
- cp -r /etc/pve/nodes/old_hosname/ /root/oldconfig
- cp /etc/pve/nodes/old_hosname/lxc/* /etc/pve/nodes/new_hostname/lxc
- cp /etc/pve/nodes/old_hosname/qemu-server/* /etc/pve/nodes/new_hostname/qemu-server
- rm -rf /etc/pve/nodes/old_hosname
- cd /var/lib/rrdcached/db/pve2-node/
- cp -r old_hosname new_hostname
- cd /var/lib/rrdcached/db/pve2-storage/
- cp -r old_hosname new_hostname
- reboot
- After restart I also changed my storage settings as well
- nano /etc/pve/storage.cfg
Anyone know if this works if ceph is set up in the cluster as well? My main reason for wanting rename nodes rather than nuke and pave them is I don't want to have to rebuild my ceph cluster over and over with each node rename.Thanks @microreal , special thanks to @homelabenthusiast
These are the steps I took to change a hostname of a node which is a member of a cluster already, and have some VMs as well. Now I don't really understand if all of these commands are necessary, I just collected some resources and made a list of my own which I thought will help, and it did work.
- Stopped all VMs [ Also Moved all important VM to another Node for my peace of mind]
- From the node terminal which I want to rename, I ran these and made changes for new_hostname
- cp -r /etc/pve /root/pve_backup
- nano /etc/hosts
- nano /etc/hostname
- nano /etc/mailname
- nano /etc/postfix/main.cf
- hostnamectl set-hostname new_hostname
- nano /etc/pve/corosync.conf (increased the config_version from 3 to 4, the version maybe different from user to user)
- pvecm updatecerts
- systemctl restart pveproxy
- systemctl restart pvedaemon
- cd /etc/pve/nodes
- cp -r /etc/pve/nodes/old_hosname/ /root/oldconfig
- cp /etc/pve/nodes/old_hosname/lxc/* /etc/pve/nodes/new_hostname/lxc
- cp /etc/pve/nodes/old_hosname/qemu-server/* /etc/pve/nodes/new_hostname/qemu-server
- rm -rf /etc/pve/nodes/old_hosname
- cd /var/lib/rrdcached/db/pve2-node/
- cp -r old_hosname new_hostname
- cd /var/lib/rrdcached/db/pve2-storage/
- cp -r old_hosname new_hostname
- reboot
- After restart I also changed my storage settings as well
- nano /etc/pve/storage.cfg
We use essential cookies to make this site work, and optional cookies to enhance your experience.