A quick issue I ran into yesterday connecting a restful API client to an NSX manager – “there was an error connecting”. As I had connected to this manager before using an API client, I knew that it was accessible at least at some point in the past. I covered all the bases of general connectivity troubleshooting at the network layer. However, this issue “there was an error connecting to NSX manager API” turned out to be something totally different.
There was an error connecting to NSX manager API
Below is the error received connecting with an API client to the NSX manager IP address:
After ruling out general network connectivity issues, I decided to take a look at the administrative interface of the NSX manager itself to see if there were any obvious errors. To do that simply browse to https://<nsx manager IP>. Under components and NSX management service I saw a disconnected error on the Lookup service URL.
When I tried to reconnect the Lookup service URL, I received an error “Time is not synchronized between NSX Manager and vCenter Server.” It appears that time is not just important in Active Directory environments! Sure enough when looking under the general settings the NSX manager time was in the wrong time zone and incorrectly configured.
I simply had to edit the time settings and allow the manager to synchronize the correct time.
After setting up the time, I had to go back to the NSX Management service and reestablish connectivity for the Lookup service URL with vCenter. After this step was completed and I had the connected green light, I was ready to try connecting again.
Immediately, after the time issue was corrected on the server with time sync as well as the lookup service URL, the connection from my API client to the NSX manager started to work.
This illustrates in a vCenter environment, it is important to make sure that time synchronization is configured correctly. Most enterprise systems whether it be Microsoft, VMware or others, start having issues with systems reporting different times. So if you receive the error: There was an error connecting to NSX manager API, once you rule out general connectivity issues, your problem may be with your time configuration. Hope this helps someone else out there who may run into this issue.