This article outlines the issue encountered when attempting to unregister a decommissioned vCenter Server from VMware Cloud Director.
When trying to unregister a vCenter Server from VCD, the following error is displayed:
[ ########-####-####-####-############ ] Failed to unregister vCenter Server "vcenter-name". Hosts from this vCenter Server are still referenced. Here are the first 1 out of 1: [esxi-name].
This prevents successful removal of the vCenter from VMware Cloud Director.
VMware Cloud Director 10.x
This issue occurs when one of the associated vCenter Server is removed directly from vCenter before it is properly unregistered or deleted from within VMware Cloud Director. As a result, VCD retains residual references to associated resources, such as ESXi hosts, within its database. These references block the unregistration process.
Identify the reference in VCD database
Locate the referenced ESXi host(s) associated with the decommissioned vCenter within the VCD database.
Confirm that these references are orphaned and no longer in use.
Take Backup
Take snapshots of all VCD cells before making any changes to the database.
Optionally, take a backup of the VCD database.
Remove the orphaned references
Remove the identified host reference(s) from the VCD database (Raise Support request with Broadcom support if assistance needed)
Unregister the vCenter from VCD
After clearing the host references, proceed to unregister the vCenter Server from within the VCD UI or API.
The un-registration should now complete successfully.
Always ensure that vCenter Server is unregistered from within VCD first before it is decommissioned from vCenter directly.
Direct database manipulation should only be performed with proper backups and under guidance from support, as it can impact VCD functionality.