Is it possible to get host name and cluster name of each VM running on VMware ESXi version 7?
Ex. In vCenter, I have
Cluster : My Cluster
Host in My Cluster : esx1.my.lab, esx2.my.lab, esx3.my.lab
And there’re many VM running on those 3 hosts.
I want to automate using REST API to GET name of every VM, Host which that VM located and Cluster of that Host.
Now I can get the List of VM and VM name by using
https://{api_host}/api/vcenter/vm
Then use each vm_id to loop and get vm name by using
https://{api_host}/api/vcenter/vm/{vm_id}
But I can’t find how to get host and cluster information from each VM.
Chaiphong Jarunavin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.