How to change the host name in a productive Proxmox Ceph HCI cluster

From Thomas-Krenn-Wiki
Jump to navigation Jump to search


This article explains how to change the host name of a system without downtime or service interruption in a productive Proxmox VE Ceph HCI cluster. Additionally, the required changes within Ceph, Corosync and HA mode of Proxmox VE are considered if the host name of a node is changed.



Important hints - this has to be read!

Make sure that the host is completely empty. It must no longer receive VMs, containers, templates or different resources. To do this, perform a bulk migration of all resources to another host before carrying out the instructions.

This tutorial is addressed to advanced users. Configuration files are adapted, which could have a negative impact on your system if it is configured incorrectly. Please follow the instructions step by step and read them completely.

These instructions refer exclusively to the change of a host name in a cluster system. Proxmox itself does not recommend the renaming of a host. The reinstallation and reintegration of hosts in a cluster would be better.

You act at your own risk

Settings and changes

The following changes and settings are made in these instructions:

  • change of the regular host name of the server
  • adaption to the Corosync-Config of Proxmox VE cluster
  • change of Ceph service name to the new host name
  • adjustment of Datacenter.cfg if necessary
  • reissue of Proxmox certificates (Web-UI/SSH)
  • adjustment of the display of HA-LRM state (datacenter -> HA)

The following values are not changed:

  • old log entries
  • old host metrics/statistics (These may be unusable due to the old name. New metrics use the new hostname)

Temporary deactivation of HA

Changing the hostname and then rebooting the server could potentially also have an impact on the HA function of Proxmox VE clusters, as a fencing (=reboot of other nodes) can be triggered. This is very unlikely if the HA is configured correctly, but potentially possible. The small risk can be minimized by temporarily deactivating the Proxmox-VE-HA with the following commands before changing the hostname:

First, the PVE-HA-LRM service has to be stopped on all other Nodes:

 systemctl stop pve-ha-lrm

Once this is done on all nodes, the PVE-HA-CRM service has to be stopped on every single node:

 systemctl stop pve-ha-crm 

The following is a list of all files and commands, which are necessary for the change of the host name under Proxmox VE 8.0.

Change of host name

Here are the instructions for the hostname and how and where it can be changed:

  1. /etc/hosts change every cluster node to the new name (PMX1 -> PMX4)
  2. /etc/postfix/main.cf rename to the individual node (PMX1 -> PMX4)
  3. set the new host name, ours is: hostnamectl hostname PMX4
hostnamectl hostname <newhostname>
  • create node directory in Proxmox cluster file systems, ours is: mkdir /etc/pve/nodes/PMX4
mkdir /etc/pve/nodes/<newhostname>
  • backup of the old node directory, ours is: cp -r /etc/pve/nodes/PMX1 /root/
cp -r /etc/pve/nodes/<oldhostname> /root/
  • Adjustment of Corosync file /etc/pve/corosync.conf (change name and config_version increase by 1!)
  • restart Corosync system on every node either via Web-UI (system) or via
     systemctl restart corosync 
  • refresh browser (delete cache if necessary),(the new host name will be displayed with a question tag)
  • If the old host name is used in the storage definition, please change it to /etc/pve/storage.cfg

Restart of server

  • restart server (to create /etc/pve/nodes/newhostname)
  • renew certificates on every node:
 pvecm updatecerts -f 
  • delete old node file in the cluster file system
 rm -rf /etc/pve/nodes/oldhostname 
  • unable to read lrm_status correct error in the datacenter --> HA view
systemctl stop pve-ha-crm.service (execute on every node)
rm -f /etc/pve/ha/manager_status (execute on individual node)
# At the end of the article, we start the pve-ha-crm.service so that HA is active again.
  • tls_process_server_certificate: certificate verify failed (596)correct mistake with:
systemctl restart pveproxy && systemctl restart pvestatd

on every node!

Ceph services(correction of host name)

Attention: It is important that Ceph is HEALTHY and that there is a quorum for the Ceph services. Please execute the following steps only with a healthy cluster state. Deleting the old Ceph monitor must not result in a quorum loss.

  • delete and recreate old Ceph monitor (so that it gets the new name)
  • delete and recreate old Ceph manager (so that it gets the new name)
  • delete and recreate old Ceph meta data service (so that it gets the new name)
  • delete old Ceph host crush map entry (Please verify health state to make sure everything is okay)
 ceph osd crush remove <oldhostname> 

Conclusion

After that, all the necessary technical changes as well as the visual corrections should be completed, and the new host should have the new name in all places. Please start on all hosts one after the other using

 systemctl start pve-ha-lrm 

the HA local resource manager and AFTERWARDS on all nodes the HA cluster resource manager using

 systemctl start pve-ha-crm

.


Author: Jonas Sterr

Jonas Sterr has been working for Thomas-Krenn for several years. Originally employed as a trainee in technical support and then in hosting (formerly Filoo), Mr. Sterr now mainly deals with the topics of storage (SDS / Huawei / Netapp), virtualization (VMware, Proxmox, HyperV) and network (switches, firewalls) in product management at Thomas-Krenn.AG in Freyung.


Translator: Alina Ranzinger

Alina has been working at Thomas-Krenn.AG since 2024. After her training as multilingual business assistant, she got her job as assistant of the Product Management and is responsible for the translation of texts and for the organisation of the department.


Related articles

Ceph: a password is required command=nvme error
Change hostname in a productive Proxmox Ceph HCI cluster
Create new MGR pool (.mgr) in Proxmox VE