Dreamer732
Contributor
Contributor

How to find ESX Host (VMHost) IpAddress?

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

0 Kudos
4 Replies
DanDaugherty
Contributor
Contributor

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.

0 Kudos
stumpr
Virtuoso
Virtuoso

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.

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
Dreamer732
Contributor
Contributor

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

0 Kudos
UmeshAhuja
Commander
Commander

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

Thanks n Regards Umesh Ahuja If your query resolved then please consider awarding points by correct or helpful marking.
0 Kudos