I need to update our machine database with the WWPN and WWNN of each ESX host. These are stored as long integers. What is the correct way to deal with a long integer like one associated with a 64bit mac? Is there a mechanism within vRO for this? If the number was stored as a string I could work with it but when I try to convert it using .toString() I end up with an incorrect value.
Hi,
something like this
for( var i = 0; i < HostObject.configManager.storageSystem.storageDeviceInfo.hostBusAdapter.length; i++ )
{
if( hbas[i] instanceof VcHostFibreChannelHba )
{
System.debug("nodeWorldWideNameHex :: "+hbas[i].nodeWorldWideNameHex);
System.debug("portWorldWideNameHex :: "+hbas[i].portWorldWideNameHex);
}
}
Hi,
something like this
for( var i = 0; i < HostObject.configManager.storageSystem.storageDeviceInfo.hostBusAdapter.length; i++ )
{
if( hbas[i] instanceof VcHostFibreChannelHba )
{
System.debug("nodeWorldWideNameHex :: "+hbas[i].nodeWorldWideNameHex);
System.debug("portWorldWideNameHex :: "+hbas[i].portWorldWideNameHex);
}
}
Where are you getting your information? I am asking how to convert from the very large number > hex. There are no hex fields as you are referencing although the vCenter client transforms it. The scriptable objects only have .nodeWorldWideName and .portWorldWideName which are both large numbers.
Here is the api page on the fibre channel hba devices
Since the number is so large javascript barfs on it. It looks like people write their own libraries to deal with this and I am wondering if vRO already has some way of dealing with these large numbers that I am not aware of. If I could successfully read in the number I could convert it but it seems to get rounded or otherwise mangled.
If you have found these already as a hex formatted string in the api please share. Thanks!
Can anyone help with this one? Seems like this is a bug to me with any plugin returning an integer that is too long for the javascript engine to process. I worked around it with a powershell call where I can convert the value to a string but we need to account for this sort of thing in the plugin or the plugin framework.
I think there are two getters in VcHostFibreChannelHba - getPortWorldWideNameHex(), getNodeWorldWideNameHex() that will format this number as string. They are not part of the vCenter API but added by the vRO plugin.
Argh... I was only looking at the api docs... I didn't see the additional getters on the plugin. Thanks everyone!