ProLiant Servers (ML,DL,SL)
cancel
Showing results for 
Search instead for 
Did you mean: 

wwpn information

 
Highlighted
Occasional Contributor

wwpn information

Is it possible to find wwpn/wwnn information for a bare metal server using powershell or REST. I looked at the HP ILO cmdlets and I do not see anything I can use to pull up the information. I could go into the ILO but trying to automate.

 

thanks

5 REPLIES 5
Highlighted
HPE Pro

Re: wwpn information

What is the Model No. of server?

What is the Installed Network card/HBA in use?

Which OS is installed on server?

 


I work for HPE

Accept or Kudo

Highlighted
Honored Contributor

Re: wwpn information

This is the PowerShell command: Get-InitiatorPort


======================
That was not planned in this way.
Highlighted
Occasional Contributor

Re: wwpn information

380 G10 or G9

 

Bare Bones no OS installed.

If an OS is installed I see a lot of approaches to get the information. I am thinking redfish might get me the answer. Two conflicting opinions, I have been told I need AMS running ie OS installed, but I have been also told I do not need it. I will test

 

thanks

 

Highlighted
Advisor

Re: wwpn information

I have the same problem at work and I wrote something that does not use the OS but just the ILO, but it only works for some models. I only tested on three models. I found this post because I don't want to rewrite this code for Gen 8 because there has to be a better way but seems not. 

DL380 Gen 10 = Works

DL380 Gen 8,9 = Failed, going to make this soon/someday. If I remember I'll post back.

You need the redfish PowerShell cmdlets, found here.

https://github.com/HewlettPackard/PowerShell-ProLiant-SDK

#########################################START OF CODE #############

$conn = Connect-HPERedfish -Address $iloip -Password $password -Username $username -DisableCertificateAuthentication

$hbalist = (Get-HPERedfishDataRaw -Odataid 'redfish/v1/Chassis/1/NetworkAdapters' -Session $conn -DisableCertificateAuthentication).Members
$HBAMASTER = @()
foreach($element in $hbalist)
{
$hbatemp = Get-HPERedfishDataraw -Odataid $element.'@odata.id' -Session $conn -DisableCertificateAuthentication
$hbamodel = $hbatemp.SKU
$hbapn = $hbatemp.PartNumber
$hbasn = $hbatemp.SerialNumber
$hbafw = (Get-HPERedfishDataraw -Odataid $element.'@odata.id' -Session $conn -DisableCertificateAuthentication).Controllers.FirmwarePackageVersion.trim(" ")
$temp = ($element.'@odata.id').TrimEnd("/") + "/NetworkDeviceFunctions/"

$temp1 = ((Get-HPERedfishDataRaw -Odataid $temp -Session $conn -DisableCertificateAuthentication).Members).'@odata.id'

$WWTEMP = ((Get-HPERedfishDataRaw -Odataid $temp1 -Session $conn -DisableCertificateAuthentication).FibreChannel)
$WWNN = $WWTEMP.PermanentWWNN
$WWPN = $WWTEMP.PermanentWWPN
$interfacetemp = ($element.'@odata.id').TrimStart("/redfish/v1/Systems/1/NetworkInterfaces/").Trim("/")
$HBAMASTER += "HBAM:$hbamodel, HBAPN:$hbapn, HBAFW:$hbafw, HBASN:$hbasn, WWNN:$WWNN, WWPN:$WWPN"
}

$HBAMASTER

############### END OF CODE #########################

Highlighted
Advisor

Re: wwpn information

I changed the code a bit. Works only on DL380 Gen 10, it seems there is no way using redfish/ilo cmdlets getting the WWNN. 

$hbalist = (Get-HPERedfishDataRaw -Odataid 'redfish/v1/Chassis/1/NetworkAdapters' -Session $conn -DisableCertificateAuthentication).Members
$hbacount = $hbatemp.Count
$hbacard = 1
$HBAMASTER = @()

foreach($element in $hbalist)
{
# Get-HPERedfishDataraw -Odataid redfish/v1/Chassis/1/NetworkAdapters/6907470F/ -Session $conn -DisableCertificateAuthentication


$hbatemp = Get-HPERedfishDataraw -Odataid $element.'@odata.id' -Session $conn -DisableCertificateAuthentication
$hbamodel = $hbatemp.SKU
$hbapn = $hbatemp.PartNumber
$hbasn = $hbatemp.SerialNumber
$hbafw = (Get-HPERedfishDataraw -Odataid $element.'@odata.id' -Session $conn -DisableCertificateAuthentication).Controllers.FirmwarePackageVersion.trim(" ")
$temp = ($element.'@odata.id').TrimEnd("/") + "/NetworkDeviceFunctions/"
$temp1 = ((Get-HPERedfishDataRaw -Odataid $temp -Session $conn -DisableCertificateAuthentication).Members).'@odata.id'
$HBAPORTCOUNT = $temp1.count
if($HBAPORTCOUNT -eq 1)
{
$WWTEMP = ((Get-HPERedfishDataRaw -Odataid $temp1 -Session $conn -DisableCertificateAuthentication).FibreChannel)
$WWNN = $WWTEMP.PermanentWWNN
$WWPN = $WWTEMP.PermanentWWPN
$interfacetemp = ($element.'@odata.id').TrimStart("/redfish/v1/Systems/1/NetworkInterfaces/").Trim("/")
$HBAMASTER += "CARD:$hbacard, PORT:1, HBAM:$hbamodel, HBAPN:$hbapn, HBAFW:$hbafw, HBASN:$hbasn, WWNN:$WWNN, WWPN:$WWPN"
}
else
{
for($i=0; $i -lt $HBAPORTCOUNT; $i++)
{

$WWTEMP = ((Get-HPERedfishDataRaw -Odataid $temp1[$i] -Session $conn -DisableCertificateAuthentication).FibreChannel)
$WWNN = $WWTEMP.PermanentWWNN
$WWPN = $WWTEMP.PermanentWWPN
$interfacetemp = ($element.'@odata.id').TrimStart("/redfish/v1/Systems/1/NetworkInterfaces/").Trim("/")
$tempi = $i + 1
$HBAMASTER += "CARD:$hbacard, PORT:$tempi, HBAM:$hbamodel, HBAPN:$hbapn, HBAFW:$hbafw, HBASN:$hbasn, WWNN:$WWNN, WWPN:$WWPN"

}
}

$hbacard++
}
$HBAMASTER