VMware Host IP Address

VMware host IP address is something of a phantom property: everybody knows it exists and use it all the time, but nobody knows where it is.

Well, this is probably because its location in the model changes depending on the host version and current network configuration.

This is how I get it.

1. For ESX systems, the system IP address is the IP address of the console, so its located at

config.network.consoleVnic["key"].spec.ip.ipAddress

where “key” is usually the only key in that collection.

2. For ESXi systems, the system IP address is the IP address of the HostVirtualNic class instance that is associated with the Management Network:

config.network.vnic["key"].spec.ip.ipAddress

where the “key” is the key of vnic that belongs to the management network portgroup.