When attempting to join an ESXi host to an Active Directory domain through vCenter Server or PowerCLI, the operation fails with one of these errors:
yyyy-mm-ddThh:mm:ss.mssZ In(30) lwsmd[process_id]: [lsass] Domain join request:
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: {
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: pszHostname = "<esxi-host-name>"
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: pszHostDnsDomain = "example.com"
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: pszDomain = "example.com"
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: pszOU = <null>
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: pszUsername = "[email protected]"
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: pszPassword = <sensitive>
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: pszOSName = "unknown"
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: pszOSVersion = "unknown"
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: pszOSServicePack = "Likewise Open 6.2.0"
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: dwFlags = 1
yyyy-mm-ddThh:mm:ss.mssZ In(30)[+] lwsmd[process_id]: }
yyyy-mm-ddThh:mm:ss.mssZ In(30) lwsmd[process_id]: [lsass] Joining domain EXAMPLE.COM
yyyy-mm-ddThh:mm:ss.mssZ In(30) lwsmd[process_id]: [lsass] Affinitized to DC 'dc01.example.com' for join request to domain 'EXAMPLE.COM'
yyyy-mm-ddThh:mm:ss.mssZ Wa(28) lwsmd[process_id]: [LwKrb5GetTgtImpl ../lwadvapi/threaded/krbtgt.c:262] KRB5 Error code: -1765328228 (Message: Cannot contact any KDC for realm 'EXAMPLE.COM')
yyyy-mm-ddThh:mm:ss.mssZ Er(27) lwsmd[process_id]: [lsass] Failed to run provider specific request (request code = 8, provider = 'lsa-activedirectory-provider') -> error = 40121, symbol = LW_ERROR_DOMAIN_IS_OFFLINE, client pid = process_id
The ESXi host attempts to connect to a domain controller that is either:
This issue occurs because ESXi relies on DNS to discover domain controllers during the domain join process and does not support specifying a particular domain controller explicitly. During the join operation, the host queries DNS for SRV records to locate the appropriate Key Distribution Center (KDC) required for Kerberos pre-authentication.
Note:
Although the host successfully established affinity with a domain controller in the target domain, the user credentials provided belong to a different Kerberos realm. The DNS infrastructure was unable to return the necessary service (SRV) records to resolve and route authentication requests to the appropriate KDC for that realm. As a result, the operation may fails with the error LW_ERROR_KRB5_REALM_UNKNOWN.
Method 1: Temporarily Configure DNS to Target a Specific Domain Controller
esxcli network ip dns server add --server=<domain_controller_ip> esxcli network ip dns server remove --server=<current_dns_server_ip>Set-VMHostAuthentication` cmdlet esxcli network ip dns server add --server=<original_dns_server_ip> esxcli network ip dns server remove --server=<domain_controller_ip>
Method 2: Check for and Resolve Network Connectivity Issues
nslookup <domain_controller_fqdn> nc -zv <domain_controller_fqdn> 88 nc -zv <domain_controller_fqdn> 389 esxcli network firewall ruleset list | grep activeDirectory
Method 3: Verify and Correct Active Directory Site Configuration
If multiple ESXi hosts at the same location have this issue: