How to Remove Stale Entries of NSX-T Manager Nodes using NSX API
As a VMware NSX expert, I recently encountered an issue while resizing NSX Manager Nodes from Medium to Large in my lab. When trying to deploy a temporary node with a new name and IP, I faced an error message indicating that the specified hostname was already in use by an existing node VM. This blog post will guide you on how to remove stale entries of NSX-T Manager Nodes using NSX API.
Causes of Stale Entries
———————-
Stale entries can occur due to various reasons such as:
* Deletion of a node without proper cleanup
* Failure during the deployment process
* Node upgrade or downgrade
* Incorrect removal of nodes from the cluster
Removing Stale Entries using NSX API
———————————–
To remove stale entries of NSX-T Manager Nodes, you can use the NSX API. The following are the steps to follow:
Step 1: Log in to the NSX Manager with root credentials.
Step 2: Run the command `curl -X GET https://localhost/api/v1/cluster/nodes/deployments -u admin:
Step 3: Identify the stale entry by comparing the list of deployments with the actual nodes in the cluster. The stale entry will have a status of “DEPLOYED” but will not be present in the actual cluster.
Step 4: Run the command `curl -X DELETE https://localhost/api/v1/cluster/nodes/deployments/
Step 5: Verify that the stale entry has been removed by running the command `curl -X GET https://localhost/api/v1/cluster/nodes/deployments -u admin:
Tips and Troubleshooting
————————-
Here are some tips and troubleshooting steps to help you resolve issues related to stale entries:
* Make sure you have logged in to the NSX Manager with root credentials to perform the above steps.
* Check the cluster status by running the command `curl -X GET https://localhost/api/v1/cluster/status -u admin:
* If you encounter any errors during the deletion process, check the error messages carefully to identify the cause of the issue.
* If the stale entry is not removed even after deleting it, try restarting the NSX Manager service and re-running the commands.
Conclusion
———-
In this blog post, we have covered how to remove stale entries of NSX-T Manager Nodes using NSX API. Stale entries can cause issues during node deployment and resizing, so it is essential to remove them correctly. By following the steps outlined in this post, you should be able to resolve any stale entry issues in your NSX-T environment.
Remember that these steps are for educational purposes only and should not be used in a production environment without proper testing and validation. Always ensure that you have a reliable backup of your NSX environment before attempting any changes.