VMware {code} Community
muthumia
Enthusiast
Enthusiast

Host IP-Address

Hi all,

In JDK environment, can anyone help me to find out IP Address of a ESX Host connected to a VirtualCenter?

Suppose If I connect to a Virtual Center and ask for all the ESX hosts connected to it, how to get the IP Address of each ESX servers?

Also, what is the key which uniquely identify a ESX-server and Virtual Machine even if the virtual machine migrated from one to other?

It would be great helpful if any immediate answers.

Thanks in advance.

Reply
0 Kudos
1 Reply
admin
Immortal
Immortal

The following snippet shows how to fetch a list of hosts connected to the esx server. The name property of the host system will identify the esx server's name or ip address. The network information about this host can be fetched through config.network. You may want to refere the vi sdk reference guide for all properties of the host system.

$host_view = Vim::find_entity_views (view_type => 'HostSystem');

Util::trace(0, "\nNumber of Hosts Connected to the VC : ".@{$host_view});

foreach (@$host_view)

Reply
0 Kudos