VMware: Configure Multipath Policy via PowerCLI

This article explains the steps on how to change Multipath Policy from “Most Recently Used” or “Fixed” to “Round Robin” on our vSphere 4.1 / 5.X and 6.X versions, but before proceeding with Multipath policy change lets briefly explain what each policy is:

Native Supported Path Policies by VMware
Policy
Description
VMW_PSP_FIXED
The host uses the designated preferred path, if it has been configured. Otherwise, the host selects the first working path discovered at system boot time. If you want the host to use a particular preferred path, specify it through the vSphere Client or by using:
esxcli storage nmp psp fixed deviceconfig set

The default policy for active-active storage devices is VMW_PSP_FIXED.

Important: VMware does not recommend you use VMW_PSP_FIXED for devices that have the VMW_SATP_ALUA storage array type policy assigned to them.
VMW_PSP_MRU
The host selects the path that it used most recently. When the path becomes unavailable, the host selects an alternative path. The host does not revert back to the original path when that path becomes available again. There is no preferred path setting with the MRU policy. MRU is the default policy for active-passive storage devices.
VMW_PSP_RR
The host uses an automatic path selection algorithm that rotates through all active paths when connecting to active-passive arrays, or through all available paths when connecting to active-active arrays. Automatic path selection implements load balancing across the physical paths available to your host. Load balancing is the process of spreading I/O requests across the paths. The goal is to optimize throughput performance such as I/O per second, megabytes per second, or response times.
VMW_PSP_RR is the default for a number of arrays and can be used with both active-active and active-passive arrays to implement load balancing across paths for different LUNs.

To check the status of the Multipath Policy you can run the following PowerCLI script:

Get Multipath Policy Per Host:

Get-VMhost ESXHOST | Get-ScsiLun -LunType disk

Get Multipath Policy Per Cluster:

Get-Cluster CLUSTERNAME| Get-VMHost | Get-ScsiLun -LunType disk

To change the Multipath Policy you can run the following command:

Get-VMHost ESXHOST | Get-ScsiLun -CanonicalName "naa.6005*" | Set-ScsiLun -MultipathPolicy "roundrobin"

Here are the the results of issuing multipath change command in vCenter:

The following PowerCLI command will display all the LUNs which are not configured with Round Robin Multipathing Policy:

Get-cluster "CLUSTER-NAME" | Get-VMHost | Get-ScsiLun | Select-Object -property VMHost, RunTimeName, CanonicalName, Vendor, MultipathPolicy | Where {$_.MultipathPolicy -notlike “RoundRobin”} | FT

The following PowerCLI command will set the multipathing policy to Round Robin on all the Datastores inside cluster:

Get-cluster "CLUSTER-NAME" | Get-VMHost | Get-ScsiLun | Where {$_.MultipathPolicy -notlike “RoundRobin”}| Set-ScsiLun -MultipathPolicy RoundRobin | Format-Table

Changing Multipathing Policy on vSphere ESXi host is non-disruptive operation.

About vmworld

Check Also

Export vCenter Logs File Bundles

ESXi 5.x host diagnostic information can be gathered using the vSphere Client connected to the ESXi host or to vCenter Server.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.