I am new to VCO. I currently automate a lot of stuff in powershell, but I am now in the process of porting those over to vCO workflows and am trying to keep everything native to vCO without having to use the powershell plugin. I currently have a powershell script that gathers the WWPNs of all hosts in a cluster so that I can put together a storage request for our storage team. I am trying to accomplish the same thing in vCO. I have create a loop so far that can list all the hosts in a cluster, but now I am trying to gather the WWPN as an array, but I am stuck. Any help at this step would be great.
moved to Orchestrator forums.
See here for some examples around WWPNs:
Geting WWN's for all storage adapters with ESXCLI and Re: ESXCLI from VCO
Convert portWorldWideName to HEX wwpn - wwn
Cheers,
Joerg
You can read the WWNN/WWPN from the HBA's like this:
for each(var hba in Host.configManager.storageSystem.storageDeviceInfo.hostBusAdapter)
{
if( hba instanceof VcHostFibreChannelHba )
{
System.log("WWNN: " + hba.nodeWorldWideNameHex);
System.log("WWPN: " + hba.portWorldWideNameHex);
}
}
Output:
[2014-05-21 10:47:02.540] [I] WWNN: 20:00:00:25:b5:df:f0:3e
[2014-05-21 10:47:02.541] [I] WWPN: 20:00:00:25:b5:df:a0:05
[2014-05-21 10:47:02.542] [I] WWNN: 20:00:00:25:b5:df:f0:3e
[2014-05-21 10:47:02.542] [I] WWPN: 20:00:00:25:b5:df:b0:05