The specified hostname is already in use by an existing auto-deployed cluster node VM. Duplicates of hostnames are not allowed. (Error code: 21016)".
2023-04-14T14:16:34.447Z INFO http-nio-127.0.0.1-7440-exec-437 NsxBaseRestController 4264 SYSTEM [nsx@6876 comp="nsx-manager" level="INFO" subcomp="manager"] Error in API /nsxapi/api/v1/cluster/nodes/deployments caused by exception com.vmware.nsx.management.common.exceptions.InvalidArgumentException: {"moduleName":"CLUSTER_NODE_VM_DEPLOYMENT","errorCode":21016,"errorMessage":"The specified hostname '<nsx-manager-fqdn>' is already in use by an existing auto-deployed cluster node VM. Duplicates of hostnames are not allowed."}
nsx-manager> detach node <node-UUID>
Node has been detached. Detached node must be deleted permanently.
GET https://<NSX-IP>/api/v1/cluster/nodes/deployments
VMware NSX 4.x
VMware NSX-T Data Center 3.x
"detach node <node-UUID>
", under certain conditions, can lead to a stale entry in the NSX Manager database.This issue is resolved in VMware NSX-T Data Center 3.2.2.1 and VMware NSX 4.0.1. Available by following instructions found at Downloading Broadcom products and software.
Workaround
Make sure you have an up to date backup in place before proceeding.
Please run the following API calls to remove the records of the NSX manager node that are no longer in use:
GET https://<NSX-IP>/api/v1/cluster/nodes/deployments
...
"vm_id": "xxxxxxx-d106-48f5-ad0a-xxxxxxxxxxx",
"roles": [
"MANAGER",
"CONTROLLER"
...
"hostname": "NSX-MANAGER-02",
POST https://<manager_ip>/api/v1/cluster/nodes/deployments/<deleted-vm-id>?action=delete
POST https://<manager_ip>/api/v1/cluster/nodes/deployments/<deleted-vm-id>?action=delete&force_delete=true
For more information, see How to Submit a Support Request.
NOTE: This API call will show all managers that were autodeployed using the NSX-T GUI. Manually deployed managers (via vCenter using OVA) will not appear in this output. For instance, the original manager used to build an NSX-T environment will not appear, revealing only 2 managers in the output of this API. If the original manager is ever detached from the cluster and redeployed via the NSX-T GUI, this API call will show all three managers.