XCAT Change the hostname of an existing node

From Define Wiki
Jump to navigation Jump to search

Remove the old names from the services

makedns -d <noderange>
makedhcp -d <noderange>
makegocons -d <noderange>

# node range works as follows
makedns -d stu-hcb[4-5]-n[1-4]
Handling stu-hcb5-n2 in /etc/hosts.
Handling stu-hcb5-n4 in /etc/hosts.
Handling stu-hcb4-n3 in /etc/hosts.
Handling stu-hcb5-n1 in /etc/hosts.
Handling stu-hcb4-n4 in /etc/hosts.
Handling stu-hcb5-n3 in /etc/hosts.
Handling stu-hcb4-n2 in /etc/hosts.
Handling stu-hcb4-n1 in /etc/hosts.

Rename the node

# node1 being the old name / node2 being the new name
chdef -t node -o node1 -n node2

Regenerate the configuration files for services with the new names

makehosts
makedns -n
makedhcp -a
makegocons

Re-install the nodes to finalise

[root@stu-dpy1 ~]# nodeset stu-hcc[4-5]-n[1-4]  osimage=centos8-x86_64-install-compute
stu-hcc4-n1: install centos8-x86_64-compute
stu-hcc4-n2: install centos8-x86_64-compute
stu-hcc4-n3: install centos8-x86_64-compute
stu-hcc4-n4: install centos8-x86_64-compute
stu-hcc5-n1: install centos8-x86_64-compute
stu-hcc5-n2: install centos8-x86_64-compute
stu-hcc5-n3: install centos8-x86_64-compute
stu-hcc5-n4: install centos8-x86_64-compute

rpower stu-hcc4-n1 cycle
rpower stu-hcc4-n[1-2] cycle # as needed