Question

Nutanix with ESXi API output


Badge

Hi everyone, I need some help.

I'd like to see the output of several Prism Element API calls in the Nutanix/ESXi hypervizor environment.

curl -ks -u 'user:pass' -X GET 'https://<prism_element_ip>:9440/PrismGateway/services/rest/v2.0/cluster'
curl -ks -u 'user:pass' -X GET 'https://<prism_element_ip>:9440/PrismGateway/services/rest/v2.0/hosts'
curl -ks -u 'user:pass' -X GET 'https://<prism_element_ip>:9440/PrismGateway/services/rest/v2.0/vms?include_vm_disk_config=true&include_vm_nic_config=true'

We are developing a monitoring/reporting tool for multiple platforms. We have recently added support for Nutanix as well. It works fine with AHV but we don't have access to a Nutanix/ESXi config.

Thanks and regards,

P.


5 replies

Userlevel 5
Badge +4

Hey @PeWu , as fat as I know the above REST API v2 actions are not supported on ESXi clusters.

Allow me some time to look into and search for the above and get back to you.:sweat_smile:

Also in the mean time here is the REST API v2 documentation https://www.nutanix.dev/reference/prism_element/v2/topics/introduction/  so that you can have a look, if not already.

Badge

Thanks, that would be great.

I hope there is some other way to get VM details, in case these API actions are not available for ESXi…

 

Userlevel 5
Badge +4

@PeWu So I researched internally and I found out that REST APIs v2 is supported on ESXi clusters. Also the above should work as well. I think there can be some issue communicating with the Prism Interface.

Can you try this and check if you can connect to the Prism gateway port using the PE IP of ESXi cluster:
 

nc -zv <PE_IP> 9440

 

Can you send me the output of below as you have issues with multiple endpoints:

curl -ks -u 'user:pass' -X GET 'https://<prism_element_ip>:9440/'

 

 

Badge

@AnishWalia20 I think you misunderstood my request :-)

I don’t have access to Nutanix/ESXi environement. So far we have developed and tested our tool on a nested NCE with AHV.

That’s why I would appreciate if anyone could provide us with outputs from a Nutanix/ESXi environment.

Userlevel 5
Badge +4

Ahh @PeWu got it. My bad I misread:smile:

 

Give me some time so I will try the above out on a test cluster and let you know.

Reply