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:
Thanks!
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);
}
}
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);
}
}
Perfect, thanks Magnus!
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