VMware Cloud Community
dcoulter
Enthusiast
Enthusiast
Jump to solution

vCO identify WWNs for FC HBAs

Hello, I'm trying to identify the WWNs of FC HBAs on ESXi 4.x/5.x via vCO.  I see HostFibreChannelHba in the vSphere API, but it doesn't look accessible from the host object:

http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fvim.host.Fibre...

Thanks!

0 Kudos
1 Solution

Accepted Solutions
ullbergm
Enthusiast
Enthusiast
Jump to solution

Take a look at the configManager.storageSystem property of the HostSystem object.

The following code dumps the HBA WWNN to the log.

var hbas = Host.configManager.storageSystem.storageDeviceInfo.hostBusAdapter;
for( var i = 0; i < hbas.length; i++ )
{
if( hbas[i] instanceof VcHostFibreChannelHba )
{
  Server.log(hbas[i].nodeWorldWideName);
}
}

Check out my orchestration blog here: http://ullberg.us/orchestrate/

View solution in original post

0 Kudos
3 Replies
ullbergm
Enthusiast
Enthusiast
Jump to solution

Take a look at the configManager.storageSystem property of the HostSystem object.

The following code dumps the HBA WWNN to the log.

var hbas = Host.configManager.storageSystem.storageDeviceInfo.hostBusAdapter;
for( var i = 0; i < hbas.length; i++ )
{
if( hbas[i] instanceof VcHostFibreChannelHba )
{
  Server.log(hbas[i].nodeWorldWideName);
}
}

Check out my orchestration blog here: http://ullberg.us/orchestrate/
0 Kudos
dcoulter
Enthusiast
Enthusiast
Jump to solution

Perfect, thanks Magnus!

0 Kudos
thechaos
Enthusiast
Enthusiast
Jump to solution

Hi,

one short question, if i see that correct the WWN is reported as an 64 bit integer, how to convert this to a hex string (that matches the information in the configuration tab of the host). In perl i'm using Math::BigInt, but how to do it in javascript. The function toString(16) returns not the complete/correct value.

Regards

     Thomas

0 Kudos