This KB provides the steps to remove an imported domain from VCF as a troubleshooting step.
VMware Cloud Foundation 9.x
Follow the steps below to perform the workaround:
1. Gather the Domain UUID from SDDC Manager
Inventory > Workload Domains and select the domain that needs to be removed.Domain ID from the browser URL.2. Remove NSX from the SDDC inventory (Note: SKIP THIS STEP IF NSX IS SHARED WITH OTHER DOMAINS.)
curl -i -X DELETE http://localhost/inventory/extensions/vi/nsxtclusterdomains/<domain-id from Step 1(c)>3. Decommission the ESXi hosts from the SDDC Manager UI.
Decommission ESX Hosts
Please see the additional information to decommission the hosts via API
4.Remove the Domain from the SDDC inventory.
curl -s -X DELETE http://localhost/inventory/extensions/vi/domains/<domain-id from Step 1(c)>
5. Clean up the vCenter MOB
Invoke Method in the bottom right corner. Close the pop-up and refresh the ExtensionManager page to ensure it is removed.Remove hosts from the domain via API
TOKEN=$(curl -H 'Content-Type:application/json' https://localhost/v1/tokens -d '{"username" : "<SSO_USERNAME>","password":"<SSO_Password>"}' -k | jq -r '.accessToken')curl -k -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -X GET https://localhost/v1/hosts?domainId=<Domain UUID from step 1(c)> 2>/dev/null | jq '[.elements[] | {id: .id}]' | tee hostids.json
curl -s -X DELETE http://localhost/inventory/extensions/decommission/hosts -H "Content-Type: application/json" -d @hostids.json