Error: "Host profile apply failed with error: Operation failed, diagnostics report: Invalid hostname, may not have '.' character." when attempting to remediate host
search cancel

Error: "Host profile apply failed with error: Operation failed, diagnostics report: Invalid hostname, may not have '.' character." when attempting to remediate host

book

Article ID: 403942

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

  • Apply host profile to ESXi host
  • When attempting to remediate host against host profile, the following vCenter UI error message appears:

    Host profile apply failed with error: Operation failed, diagnostics report: Invalid hostname, may not have '.' character

  • Host is compliant after manually applying all host profile settings to the host, but the error message persists in the vCenter UI
  • ESXi - /var/log/syslog.log


    YYYY-MM-DDTHH:MM:SSZ In(14) hostprofile[2115209]: opID=mb4df5ai-934585-auto-k15p-h5:70225946-6a-01-76-2e43: Applying dnsConfig (vim.host.DnsConfigSpec) {

    YYYY-MM-DDTHH:MM:SSZ In(14)[+] hostprofile[2115209]:    hostName = 'esxi.example.com',
    YYYY-MM-DDTHH:MM:SSZ In(14)[+] hostprofile[2115209]:    domainName = 'example.com',

    YYYY-MM-DDTHH:MM:SSZ Er(11) hostprofile[2115209]: opID=mb4df5ai-934585-auto-k15p-h5:70225946-6a-01-76-2e43: Exception while applying host config. Exception: (
    vim.fault.PlatformConfigFault) {
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:    dynamicType = <unset>,
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:    dynamicProperty = (vmodl.DynamicProperty) [],
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:    msg = 'An error occurred during host configuration: .',
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:    faultCause = <unset>,
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:    faultMessage = (vmodl.LocalizableMessage) [
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:       (vmodl.LocalizableMessage) {
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:          dynamicType = <unset>,
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:          dynamicProperty = (vmodl.DynamicProperty) [],
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:          key = 'com.vmware.esx.hostctl.default',
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:          arg = (vmodl.KeyAnyValue) [
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:             (vmodl.KeyAnyValue) {
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:                dynamicType = <unset>,
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:                dynamicProperty = (vmodl.DynamicProperty) [],
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:                key = 'reason',
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:                value = "Invalid hostname, may not have '.' character"
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:             }
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:          ],
    YYYY-MM-DDTHH:MM:SSZ Er(11)[+] hostprofile[2115209]:          message = "Operation failed, diagnostics report: Invalid hostname, may not have '.' character"

Cause

This occurs when the host's customization file has a malformed hostname that includes the '.' character.

Resolution

  1. Log into the vCenter UI.
  2. Right click on the affected ESXi host and select "Host Profiles."
  3. Click on "Edit Host Customizations..."
  4. In the "Customize hosts" window, look for:
    • Property Name = Name for this host
    • Path: Networking configuration > Netstack instance > defaultTcpipStack > DNS configuration > Host name
  5. In the associated Value field, edit the existing entry and remove the '.' character.
  6. Click OK.
  7. Re-attempt to remediate the host.