Hi,
Sure it's possible to convert the LUN Serial number to its Naa number for clustered data ONTAP using PowerShell. Here is a simple example
Import-Module DataONTAP
$cluster = "cluster1.netapp.com"
$vserver = "vserver1"
$lunPath = "/vol/vol1/luns/lun1"
$identifier = "naa.600a0980"
$credentials = $host.ui.PromptForCredential("Connect to cluster $cluster", "Please enter the user name and password","","")
$cluster = Connect-NcController $cluster -Credential($cred)
$lun = Get-NcLun -Vserver $vserver -Path $lunPath -Controller $cluster
$serialNumber = $lun.SerialNumber
$ca = $serialNumber.ToCharArray();
$naasn = $null
Foreach($byte in $ca){
$naasn = $naasn + [System.String]::Format("{0:x}", [System.Convert]::ToUInt32($byte))
}
Write-Host "LunPath,LunSerial,NaaNumber"
Write-Host "$lunPath,$serialNumber,$identifier$naasn"
The output will look like:
LunPath,LunSerial,NaaNumber
/vol/vol1/luns/lun1,BpEwv$ElzqhW,naa.600a0980427045777624456c7a716857
Also note that you can use the "lun serial -x" command in ONTAP 8.3 if you'd prefer to use the CLI. See following KB
https://kb-stage.netapp.com/support/index?id=1012613&page=content&locale=en_US
/matt
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.