Hostname configurations in VMware Aria Operations for Logs 8.14+
search cancel

Hostname configurations in VMware Aria Operations for Logs 8.14+

book

Article ID: 315950

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

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.

Environment

VMware Aria Operations for Logs 8.14.x and higher

Cause

loginsight_set_hostname.service sets the hostname by

  1. retrieving information from the VMware environment using vmware-rpctool
    /usr/bin/vmware-rpctool 'info-get guestinfo.ovfEnv' | grep hostname
  2. If vmware-rpctool returns an empty value or no value, the hostname is set to the result of a reverse DNS query for the appliance VM's IP address.

  3. If both  vmware-rpctool and reverse DNS lookup fail to return a value, the hostname is set to localhost

Resolution

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.

  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 and click vApp Options

    Note: If vApp Options are currently disabled, use steps from Restoring the vApp properties in Aria Operations for Logs

  3. Under Properties, select the key named hostname

  4. Click SET VALUE, enter the desired hostname and click OK

  5. Power on the VM

  6. Verify that the DNS Name under the Virtual Machine Details on the VM Summary page in the vSphere Web Console is updated successfully

  7. Log in to the Aria Operations for Logs VM as root via vSphere Console or SSH

  8. Verify that the hostname is updated successfully by executing
    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

  1. Log in to the Aria Operations for Logs VM as root via vSphere Console or SSH

  2. Create a file named 'hostname.sh' in the current directory by the running the below command:
    vi hostname.sh
  3. Copy the script 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 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
  4. Save the file and change permission by running the below command:
    chmod 777 hostname.sh
  5. Run the below command to execute the script
    ./hostname.sh
  6. Verify that the hostname is updated successfully by executing
    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.