Attempts to create or extract a Host Profile from an ESXi host fail with a general system error.
Error visible in the vSphere Client or /var/run/log/hostd.log: vmodl.fault.SystemError message = "Failed to read the current contents of the hosts file"
Error visible in /var/run/log/syslog.log:
hostprofile: Calling GatherData() for profile type EtcHostsProfile hostprofile: /etc/hosts in file {('<REDACTED_IPS>', '<REDACTED_HOSTNAMES>', ('alias',), '')...}
VMware ESXi
VMware vCenter Server
This issue occurs when the /etc/hosts file on the ESXi host has been manually edited or modified using unsupported tools such as configstorecli.
Such changes create inconsistencies between the configstore and system-level configurations, which can break components relying on consistent networking and identity resolution, such as Host Profiles or vLCM.
Remove the manually added entries directly from the /etc/hosts file on the affected ESXi host.
Reboot the ESXi host to restore the default configuration state.
Re-add the required host mappings utilizing the supported esxcli namespace.
Command syntax for adding a new host entry: esxcli network ip hosts add --ip <xx.xx.xx.xx> --hostname <xxxxxxxx> --alias <xxxxxxxx>
Command syntax for listing existing entries: esxcli network ip hosts list
Command syntax for removing an incorrect entry: esxcli network ip hosts remove --ip <xx.xx.xx.xx> --hostname <xxxxxxx>
Re-attempt the Host Profile extraction from vCenter Server.
Editing /etc/hosts directly is no longer supported in ESXi 7.0 U3 and later. The use of esxcli ensures:
Proper configstore synchronization
Compatibility with hostd/vpxa services
Successful use of features like Host Profiles and vLCM