There is a service (loginsight_set_hostname.service) in the VMware Aria Operations for Logs appliance (versions 8.14 and higher) that is responsible for performing checks and setting a hostname when the appliance is booting. The logic of this service is as follows.
First, it retrieves VM information from the VMware environment using vmware-rpctool.
The following command can be executed manually to view the hostname value that the appliance gets from the VM's vApp Options:
/usr/bin/vmware-rpctool 'info-get guestinfo.ovfEnv' | grep hostname
If this command returns a value and it's not empty, the Aria Logs appliance will use this value as its hostname.
If the command returns an empty value or no value found, the Aria Logs appliance will perform DNS queries to see if there is an associated record for its IP address. If the NameServers return a record, the Aria Logs appliance will use this name as its hostname. If the NameServers are not able to resolve the IP address, then "localhost" will be selected as the hostname of the appliance.
How to change the hostname of VMware Aria Operations for Logs appliance.
Update the DNS records to change the hostname in scenarios when the hostname originates from DNS servers and the node is not represented in the cluster with its FQDN. Otherwise, this may break the cluster. Ensure that the following conditions are met:
1. Log in to UI with the appropriate access level to access the cluster page.
2. Select Cluster from Management dropdown menu
3. Verify that the node is represented with its IP address
Update the hostname field in vApp Options in scenarios when the hostname originates from vApp Options.
This is a good practice when the hostname field in vApp Options is not empty and has the value that matches to the DNS records.
However, there can be situations when the vApp Options are disabled and no local DNS server is configured.
How to change the hostname when vApp Options are disabled, and no local DNS configured.
Please note that 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.
1. SSH to the node as root
2. Execute the commands below to update the /etc/hosts file with the new hostname:
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 the <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
3. Verify that the hostname is updated successfully by executing
hostname hostnamectl | grep hostname cat /etc/hosts
How to change the hostname from vApp Options:
1. Select the VMware Aria Operations for Logs VM in the vSphere Web Client and click Power > Shut Down Guest OS
2. Navigate to the Configure tab, choose vApp Options from Settings drop down. Under Properties, select the key named hostname.
3. Click SET VALUE, enter the desired hostname and click OK.
4. From Power > Power On, power on the VM
5. Verify that the DNS Name under the Virtual Machine Details is updated successfully by selecting the VM and going to the Summary page
6. SSH to the node as root
7. Verify that the hostname is updated successfully by executing
hostname hostnamectl | grep hostname cat /etc/hosts