Check correct path policy of RDMs

Our vSphere version combined with EMC VNX MCX OE version advices Round Robin as path policy. For RDMs used by a Microsoft Cluster however, Most-Recently-Used is the adviced policy. If a Microsoft Cluster has the incorrect path policy, there is a hughe latency on the RDM. We have noticed that reboot of the ESXi host or forced rescan of the HBA will reset the path policy selection.

To be able to keep an eye on unwanted changes in path policy, we use the famous vCheck by Alan Renouf and added our own plugin. 

$Report = @()
$GevondenMRULuns = 0
$Header = "" 

foreach($vm in (Get-View -ViewType VirtualMachine)){
 $vm.Config.Hardware.Device | where {$_.gettype().Name -eq "VirtualDisk"} | %{
 if("physicalMode","virtualmode" -contains $_.Backing.CompatibilityMode){
 $diskUUID = $_.Backing.LunUuid.Substring(10,32)
 $esx = Get-View $vm.Runtime.Host
 $lun = $esx.Config.StorageDevice.ScsiLun | where {$_.CanonicalName.Split(".")[1] -eq $diskUUID}
 if($lun){
 $lunscsi = Get-VMHost $esx.Name | Get-ScsiLun -CanonicalName $lun.CanonicalName 

 If( $lunscsi.MultipathPolicy -ne "MostRecentlyUsed" )
 {
 # NOT mru
 $row = "" | Select ESXiHost, CanonicalName, MultiPathPolicy, VMName, Status
 $row.ESXiHost = $esx.name
 $row.CanonicalName = $lun.canonicalname
 $row.MultiPathPolicy = $lunscsi.Multipathpolicy
 $row.VMName = $vm.Name
 $row.Status = "ERROR"
 $Report += $row

 }
 else
 {
 # MRU
 $GevondenMRULuns = $GevondenMRULuns + 1

 $row = "" | Select ESXiHost, CanonicalName, MultiPathPolicy, VMName, Status
 $row.ESXiHost = $esx.name
 $row.CanonicalName = $lun.canonicalname
 $row.MultiPathPolicy = $lunscsi.Multipathpolicy
 $row.VMName = $vm.Name
 $row.Status = "CORRECT"
 $Report += $row

 }
 }
 }
 }
}

$Header = "RDMs with incorrect pathpolicy $(@($Consol).Count-1), RDMs with CORRECT pathpolicy $GevondenMRULuns"
$Title = "RDMs with incorrect path"
$Comments = "Path policy can either by Fixed Path, Most Recently Used or Round Robin. For physical RDMs the MRU policy is adviced"
$Display = "Table"
$Author = "Gabrie van Zanten"
$PluginVersion = "1"
$PluginCategory = "vSphere"

# Output to console
$Report

$Header

</pre>
<pre>

 

4 thoughts on “Check correct path policy of RDMs

  1. Hi Gabe, does this also count when for example the VNX is behind a VPLEX? The VPLEX default policy is set to Round-Robin as well for both RDM and VMFS due to it having Active/Active controllers.

  2. Hi. I don’t know since I don’t have a vPlex environment to test against. But if you run the script in an editor and when it is done, see what is in $report. It will show you for each RDM the path policy that is set.

  3. vSphere 5.1. The roll out of 5.5 is going strong but we’re waiting for some other components like Citrix XenApp and Citrix Netscaler that first need to be upgraded to latest releases to be compatible with vSphere 5.5.

    And I already saw the 5.5 changes for MSCS, eagerly waiting for it :-) But also hoping more database switch to logshipping.

Comments are closed.