Updating Hostname in OpenPBS Configuration After Cloning AWS Instance

Hi,

I am setting up a quick-start machine for using OpenPBS with Ubuntu.

Currently, OpenPBS is installed on an AWS instance, and we want to clone this setup for other users/machines.

However, I am encountering an issue where hostname information is not being updated correctly. For example, on a freshly cloned machine, the pbsnodes -a command still shows the old hostname:

**
ubuntu@newhostname:~$ pbsnodes -a
oldhostname
Mom = oldhostname.ec2.internal
ntype = PBS
state = free
pcpus = 2
resources_available.arch = linux
resources_available.host = oldhostname
resources_available.mem = 8125288kb
resources_available.ncpus = 2
resources_available.vnode = oldhostname
resources_assigned.accelerator_memory = 0kb
resources_assigned.hbmem = 0kb
resources_assigned.mem = 0kb
resources_assigned.naccelerators = 0
resources_assigned.ncpus = 0
resources_assigned.vmem = 0kb

**
How can I update the hostname from oldhostname to newhostname in all configurations?

Thank you in advance for the assistance :slight_smile:

Make sure the pbs service (pbs_mom) is the last service that is going to be started on the comppute node, before starting the pbs service update the /etc/pbs.conf , make sure the old node is removed (not mandatory) , but make sure this new node is added after the service is started .

sed -i "/PBS_SERVER/c\PBS_SERVER=\`$(hostname)\`"  /etc/pbs.conf

qmgr : d n nodename
qmgr : c n newnodename
Note: you cannot update the node configuraton of the oldnode that is added previously with the newhostanme , delete the old node (if required) , otherwise just create a new node with the new hostname everytime a node is created.

Hope this helps