Solved

Nutanix with ESXi API output

  • 31 July 2020
  • 6 replies
  • 1203 views

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.

icon

Best answer by AnishWalia20 26 August 2020, 14:51

View original

This topic has been closed for comments

6 replies

Userlevel 6
Badge +5

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 6
Badge +5

@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 6
Badge +5

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.

Userlevel 6
Badge +5

API v3 is currently not supported on ESXi clusters, whereas API v2 works just fine and are exactly the same as it works on AHV clusters. 

 

Below are some of the useful links:

  1) for the VM: https://www.nutanix.dev/reference/prism_element/v2/api/vms/get-vms-getvms/

2) Cluster: https://www.nutanix.dev/reference/prism_element/v2/api/cluster/get-cluster-getclusterinfo/

3) Hosts: https://www.nutanix.dev/reference/prism_element/v2/api/hosts/get-hosts-gethosts/


All this can be found here: https://www.nutanix.dev/reference/prism_element/v2/api