Customization of Linux guests does not produce FQDN for hostname
search cancel

Customization of Linux guests does not produce FQDN for hostname

book

Article ID: 344279

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
  • Customization of Linux guests does not produce a FQDN for hostname
  • Only the machine name is set in /etc/hostname (for Debian-based systems) or /etc/sysconfig/network (for Redhat-based systems)
  • The issue occurs on RHEL 5.4
  • This issue does not occur in vCenter Server 2.5


Environment

VMware vCenter Server 5.5.x
VMware vCenter Server 7.0.x
VMware vCenter Server 4.1.x
VMware vCenter Server 5.0.x
VMware vCenter Server 5.1.x
VMware vCenter Server 4.0.x
VMware vCenter Server 6.x

Resolution

The behavior is by design. Customization of the hostname on a Linux guest in vCenter Server 4.x and 5.x has changed from vCenter Server 2.5.
Unlike vCenter Server 2.5, vCenter Server 4.x does not concatenate machine name and domain name to produce the hostname/FQDN. A new field has been introduced for the domain name.
The extract of /var/log/vmware-imc/toolsDeployPkg.log for VMware Infrastructure 3.5:

DEBUG: [NETWORK]
DEBUG: FOUND CATEGORY = NETWORK
DEBUG: NETWORKING = yes
DEBUG: ADDED KEY-VAL :: NETWORK|NETWORKING = yes
DEBUG: BOOTPROTO = dhcp
DEBUG: ADDED KEY-VAL :: NETWORK|BOOTPROTO = dhcp
DEBUG: HOSTNAME = server.vmware.com
DEBUG: ADDED KEY-VAL :: NETWORK|HOSTNAME = server.vmware.com
DEBUG:
DEBUG: Empty line. Ignored.
DEBUG: [NIC-CONFIG]

INFO: Customizing Hosts file ...
INFO: Replacing template.vmware.com with server.vmware.com in the hosts file ...
DEBUG: opening file /etc/hosts.

Note: The line DEBUG: HOSTNAME = server.vmware.com shows the machine name and the domain that are concatenated to produce the hostname/FQDN.

The extract of /var/log/vmware-imc/toolsDeployPkg.log for VMware vSphere 4.x and 5.x:

DEBUG: [NETWORK]
DEBUG: FOUND CATEGORY = NETWORK
DEBUG: NETWORKING = yes
DEBUG: ADDED KEY-VAL :: NETWORK|NETWORKING = yes
DEBUG: BOOTPROTO = dhcp
DEBUG: ADDED KEY-VAL :: NETWORK|BOOTPROTO = dhcp
DEBUG: HOSTNAME = server
DEBUG: ADDED KEY-VAL :: NETWORK|HOSTNAME = server
DEBUG: DOMAINNAME = vmware.com
DEBUG: ADDED KEY-VAL :: NETWORK|DOMAINNAME = vmware.com
DEBUG:
DEBUG: Empty line. Ignored.
DEBUG: [NIC-CONFIG]

INFO: Customizing Hosts file ...
INFO: Replacing template.vmware.com with server in the hosts file ...
DEBUG: opening file /etc/hosts.

Note: The lines DEBUG: HOSTNAME = server and DEBUG: DOMAINNAME = vmware.com shows the hostname is the assigned machine name and is not concatenated with the domain name.
To work around, log in to the guest operating system and using vi or the nano editor manually set the FQDN in /etc/hostname (for Debian-based and systems) or /etc/sysconfig/network (for Redhat-based systems).


Additional Information

For more information on using vi or nano, see Editing files on an ESX host using vi or nano (1020302).