Today while cleaning up my lab, I came across situation where I needed to delete one of the deployed controllers. Although this task is fairly simple from vCenter UI, but recently I came across a situation (in VMware HOL) where I was unable to delete a controller via UI.
As an alternative, I came across set of API calls which did the job for me. In this post I will demonstrate how to use API calls to delete stuck/bad NSX controllers.
Step 1: Fetch controller details
# CONTENT-TYPE: application/xml
# METHOD: GET
# API CALL: https://NSX-MGR-IP/api/2.0/vdn/controller/
Example: curl -sik -u “firstname.lastname@example.org” -H ‘Content-Type: application/xml’ -X GET https://nsxmgr-01a.corp.local/api/2.0/vdn/controller | tidy -xml -indent -quiet