The service loginsight_set_hostname.service in the VMware Aria Operations for Logs appliance versions 8.14 and higher dynamically sets a hostname when the appliance is booting.
loginsight_set_hostname.service sets the hostname by
/usr/bin/vmware-rpctool 'info-get guestinfo.ovfEnv' | grep hostname
localhost
Restoring the 'vApp Options' properties in Aria Operations for Logs.
Updating the hostname via Command Line interface.
Note: It is recommended to take a snapshot before following the steps below.
Steps to change the hostname of VMware Aria Operations for Logs appliance.
hostname
hostnamectl | grep hostname
cat /etc/hosts
Note: When unable to use vApp Options in the environment, update the DNS server used by the Aria Operations for Logs appliance VM with a Pointer (PTR) record that relates the VM's IP to the correct hostname.
If the above doesn't resolve follow the below steps to update the hosts file via Command line interface.
Steps to change the hostname when vApp Options are disabled, and no DNS servers available
vi hostname.sh
systemctl disable loginsight_set_hostname.service
/opt/vmware/bin/init/set_hostname.py
current=`hostname`
if [[ $current == *.* ]]; then
current_name=$(echo "$current" | cut -d '.' -f1);
current="$current $current_name";
fi
hostnamectl set-hostname your_new_hostname
#NOTE: change your_new_hostname with the desired hostname
new=`hostname`
if [[ $new == *.* ]]; then
new_name=$(echo "$new" | cut -d '.' -f1);
new="$new $new_name";
fi
sed -i "/^127\.0\.0\.1\|^::1/! s/\b$current\b/$new/" /etc/hosts
chmod 777 hostname.sh
./hostname.sh
hostname
hostnamectl | grep hostname
cat /etc/hosts
Note: When changing the hostname using this method, it may be reverted after upgrading the version of VMware Aria Operations for Logs. In that case, the procedure should be re-executed.