Hi Ron,
I tried to make the script you were searching for, but didn't understand what you mean with "Runtime Name" and I don't know how to retrieve the firmware version. So I let those two out. With the identifier I didn't know which one to choose, because there are more than one. If I have put things on the wrong place maybe you can give an example of a line of output with real data, as you would like to see it.
Function Get-DatastoreByHba {
param([string]$Hba)
$Datastores = Get-Datastore | Get-View
$Datastore = $Datastores | `
ForEach-Object {$_.Info.Vmfs} | `
ForEach-Object {
$Vmfs = $_
$Vmfs | `
ForEach-Object {$_.Extent } | `
Where-Object {$_.DiskName -eq $Hba} | `
ForEach-Object {$Vmfs.Name}
}
Return $Datastore
}
$Datastores = Get-Datastore | Get-View
Get-VMHost | ForEach-Object {
$VMHost = $_
$VMHostHBA = $VMost | Get-VMHostHba
$VMHost | Get-ScsiLun | ForEach-Object {
$ScsiLun = $_
$ScsiLun | Get-ScsiLunPath | ForEach-Object {
$ScsiLunPath = $_
$HBA = $VMHostHBA | Where-Object { $_.Device -eq $ScsiLunPath.Name.Split(":")[0]}
$wwn = $HBA.PortWorldWideName
$wwnhex = "{0:x}" -f $wwn
$Report = "" | Select-Object -Property VMHost,Device,Identifier,CapacityMB,Datastore,MultipathPolicy,State,PWWN,Vendor
$Report.VMHost = $VMHost.Name
$Report.Device = $ScsiLunPath.Name
$Report.Identifier = $ScsiLunPath.ScsiLunID
$Report.CapacityMB = $ScsiLun.CapacityMB
$Report.Datastore = Get-DatastoreByHba -Hba $ScsiLunPath.Name
$Report.MultipathPolicy = $ScsiLun.MultipathPolicy
$Report.State = $ScsiLunPath.State
$Report.PWWN = $wwnhex
$Report.Vendor = $ScsiLun.Vendor
$Report
}
}
}
The PWWN conversion code is borrowed from LucD.
Because the forum software has problems with square brackets, and the script contains them, I have attached the script also.
Regards, Robert