Hi,
How to find ipaddresses of ESX Hosts (VMHosts) in a vcenter?
I have looked at the http://communities.vmware.com/message/780627#780627 as its related.
So i looked at the config.network proeprty but couldnt find the ipaddress of the host.
Looks like I am missing something obvious.
Can you help me find the actual property?
Regards,
Dreamer
The ip addresses of the virtual nics for a host are buried in the networkInfo property of the HostSystem.
configManager.networkSystem.networkInfo.vnic[].spec.ip.ipAddress
I just looked at your image and it looks like you should be using configManager.networkSystem.networkInfo.consoleVnic[].spec.ip.ipAddress instead.
The problem with just going to config.network.vnic[] is that you will not know what vnic type it is (management, vmotion, etc).
The best solution is to use QueryNetConfig from HostVirtualNicManager. Use 'management' for the nicType (I'm assuming you want the management ip). That will return a list of HostVirtualNic[]. You can get the vmk device, mac and ip address quickly this way and it will support configurations where you have multiple management interfaces.
Thank you.
I think it should work. I was able to look at the ipaddress in object browser.
I will give it a try and update you.
Regards,
Dreamer
Hi,
There are two option from where you can get the Host IP address.
1) Go to Home --> Inventory --> Host and Cluster --> Configuration --> Networking --> Management Network Ip is your host IP
OR
2) If you have database access of VCenter then you can run the below query
select DNS_NAME,IP_ADDRESS from dbo.VPX_HOST
I followed the below article to get vCenter IP details on Esxi host
https://vmkfix.blogspot.com/2023/02/how-to-check-vcenter-ip-address-on-esxi.html