VMware {code} Community
molin
Contributor
Contributor

Find Fibre Channel HBA WWPN (SAN Idenifier) with java VI API

When using the Infrastructure Client I can select a Host Server, select Configuration Tab, select Storage Adaptors I can see the WWPN for my Fibre Channel hbas in the form of xx:xx:xx:xx:xx:xx:xx:xx. When using both the web based Object Browser and the java API I can't seem to find this information. I'm able to get to the HostFibreChannelHba objects both ways but I don't see the WWPN.

The Infrastructure Client is v2.5 and the host servers are running ESX 3.0.

Is there a way to get this information? If so, is there an example?

Thanks in advanced.

0 Kudos
2 Replies
admin
Immortal
Immortal

You should start off with a managed object reference to the host, navigate to it's property config.storageDevice.hostBusAdapter.

This will return you an array of host bus adapters, available on the host. The data object host bus adapter is extended by HostFiberChannelHba. Iterating through the host bus adapters, you can print the property portWorldWideName for "The world wide port name for the adapter".

Below is the reference to the extract from the vi sdk reference guide:

0 Kudos
molin
Contributor
Contributor

I was messing up on the fact that that HostFiberChannelHba's portWorldWideName is a long and I was looking for the Hex string. Doing a converstion to Hex fixed the problem.

Thanks for the help.

0 Kudos