How to Get Path Selection Policy of Physical RDM LUN by PowerCLI

It’s frustration to check RDM information, you have to check across  all ESXi hosts to make sure configuration is aligned. I just figured out two line commands to get path selection policy (aka PSP).

[do_widget “Language Switcher” wrap=aside title=false]

$VM  = Get-hardDisk -VM [VM name] -DiskType RawPhysical

$VM | select ScsiCanonicalName | foreach {Get-Cluster -Name [Cluster name] | Get-VMHost | Get-ScsiLun -CanonicalName
$_.ScsiCanonicalName} | select CanonicalName,CapacityGB,MultipathPolicy,VMHost | Format-Table -AutoSize

You should replace [VM name] & [Cluster name] by your own value.

Run these commands on PowerCLI it gives back PSP of RDM LUNs with LUN NAA and ESXi host name. As you may know ESXi 5.5 supports PSP “Round Robin” instead of Fixed for physical RDM LUNs, you may also want to change the PSP after upgrading to ESXi 5.5, please read How to retrieve or set Path Selection Policy by vCLI to learn how to set PSP in batch.