When attempting to add an ESXi host back to vCenter Server inventory (typically after a management IP address change or host removal), the task fails with the following errors:
A failure occurred when starting a host compliance check operation on host <ESXi_Hostname> : Error: system_error Messages: vapi.invalid.result.code<Recv of frame failed with code: 503 Service Unavailable>YYYY-MM-DDTHH:mm:ss.SSSZ info vpxd[38185] [Originator@6876 sub=vmomi.soapStub[8] opID=mo1m5okn-1263882-auto-r37x-h5:70153921-7d-01-01-LicenseClientUnregisterHostAsync-7862abcc] SOAP request returned HTTP failure; <<cs p:00007efca80022c0, TCP:localhost:<ID>>, /ls/sdk>, method: unregisterEntity; code: 500(Internal Server Error); fault:(vim.fault.LicenseEntityNotFound) {--> faultCause = (vmodl.MethodFault) null,--> faultMessage = <unset>,--> entityId = "host-<ID>"--> msg = "Received SOAP response fault from [<<cs p:00007efca80022c0, TCP:localhost:1080>, /ls/sdk>]: unregisterEntity--> "--> }YYYY-MM-DDTHH:mm:ss.SSSZ error vpxd[19679] [Originator@6876 sub=vpxLro opID=mo1m5okn-1263882-auto-r37x-h5:70153921-7d-01-01] [VpxLRO] Unhandled exception: N4Vpxd7Clients29BadVapiConfigurationExceptionE(Error:--> system_error--> Messages:--> vapi.invalid.result.code<Recv of frame failed with code: 503 Service Unavailable>--> )--> [context]zKq7AVECAQAAALa6fwEbdnB4ZAAAyzdIbGlidm1hY29yZS5zbwAArDA3AA9VOIFI74kCdnB4ZACBrVGKAoFsXYoCgeFfigKBy2CKAoGJBSkCgQkOKQKBtSIpAoHr1kIBgbzxQgGB3PlKAoEtKUsCgSY1LgGBxDYuAYFTay4BgaEArgKBURGuAoHrHq0Cgfb5rQIABPwsAA9VLQDrKkYCxJAIbGliYy5zby42AAKskRA=[/context]YYYY-MM-DDTHH:mm:ss.SSSZ invocation-vmomi-executor-1 opId=mo1m5okn-1263882-auto-r37x-h5:70153921-7d-01-01-LicenseClientUnregisterHostAsync-7862abcc ERROR server.core.oldmanagement.vmomi.LicenseAssignmentManagerMoImpl Missing license entity host-<ID>:0d605cfd-2a60-47b7-8e67-bfb9dcc60b23com.vmware.cis.license.vpx.server.core.oldmanagement.LicenseAssignmentManagerException$NotFound: Missing license entity host-<ID>:0d605cfd-2a60-47b7-8e67-bfb9dcc60b23 at com.vmware.cis.license.vpx.server.core.oldmanagement.impl.LicenseAssignmentManagerBaseImpl.queryDaoLicenseEntityOrThrowIfNotFound(LicenseAssignmentManagerBaseImpl.java:438) ~[license-vpx-server-core-9.0.2.jar:?] at com.vmware.cis.license.vpx.server.core.oldmanagement.impl.LicenseAssignmentManagerImpl.unregisterEntityInt(LicenseAssignmentManagerImpl.java:1192) ~[license-vpx-server-core-9.0.2.jar:?]This issue occurs because stale registration data or orphaned license entities remain in the vCenter Server database (VCDB) or the VMware Directory Service (vmdir) for the host's previous registration. When vCenter attempts to add the host, the VAPI service encounters a conflict with these existing but "missing" entities, resulting in a 503 Service Unavailable response during the compliance check.
To resolve this issue, you must manually remove the stale host and license entries from the vCenter database and the License Service.
Note: Take a file-based backup or snapshot of the vCenter Server Appliance (VCSA) before proceeding.
/usr/bin/ldapsearch -LLL -b "dc=vsphere,dc=local" -s sub -D "cn=administrator,cn=users,dc=vsphere,dc=local" -W > ldif-export.ldif
dn: cn=AssetEntity_host-<ID>... that matches the hostname of the impacted hostldapdelete -x -D "cn=administrator,cn=users,dc=vsphere,dc=local" -W "cn=AssetEntity_host-<ID>-<UUID>,cn=LicenseService,cn=services,dc=vsphere,dc=local"/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgresID of the stale host: