0

How to set round robin path and multipath policy for datastore in VMware

 

This Article will let you know How to set round robin multipath policy for Data Store in VMware

What is Multipath policy in storage: It means that your LUN is coming from different storage switches which are coming from different zoning for redundancy purpose.

 

 

What is round robin path policy: This is an algorithm which is used to manage path which are currently available in active state. Here in above diagram where we have one storage device that is connected two switches, both are having two ports.
We have two SAN switches that are connected from Storage Port 1, Port 2 and these are further connected with physical server that is having  HBA Cards.
In Virtual environment if Storage team provides you a LUN, then only the two active paths in this datastore will be visible. Actually the fabric switches are configured with “Zoning”.

 

In VMware Multipath is used to provide redundancy on datastore.

 

VMware is having 3 Multipath Policy: a) Most Recently Used b) Round Robin c) Fixed

Most Recently Used (MRU): In this Policy ESXi use first working path and if first path is not available then it goes to next path. This will not return to first path until unless path is not available. These LUN’s coming from Active/Passive Storage array.
Fixed (Fixed): In this policy ESXi use only assigned path only, else this will start using first working path which was discovered at boot time. In this policy host automatically returns to first path when it will be available. These LUN’s is Active/Active Storage array example.
Round Robin (RR): In this policy ESXi use Automatic path selection and use all available paths by rotationally. It helps us in distributing load across the configured paths. Recommendation is to use this RR policy in your environment for all Data stores to get better performance and redundancy.

 

 

We can make Data Store Round Robin in two ways:   1. Script 2. Manually

 1st Method-> Script:
Here is the script you have to run this script on vCenter Server.
Log in into vCenter server and open power shell and provide the script path and enter. Rest script will do but before that you have to save as this script with extension .ps1

 

 

# Set pathing policy to RoundRobin

Get-Cluster “Here Cluster name” | Get-VMHost | Get-ScsiLun -CanonicalName “naa.*” | Set-ScsiLun -MultipathPolicy

“RoundRobin”

Below Script can be use for getting default storage path policy on particular ESXi Server .

# Check default pathing policy on host

Get-VMHost “Hostname (FQDN)” | ForEach-Object {

$esxcli = Get-EsxCli -VMHost $_

$esxcli.storage.nmp.satp.list()

}

Below Script can be use for setting storage path policy to Round Robin on particular ESXi Server.

# Set default pathing policy for single host

Get-VMHost “Hostname (FQDN)” | ForEach-Object {

$esxcli = Get-EsxCli -VMHost $_

$esxcli.storage.nmp.satp.set($null,”VMW_PSP_RR”,”VMW_SATP_DEFAULT_AA”)

}

Below Script can be use for setting storage path policy default to Round Robin on particular cluster .

# Set default pathing policy for all hosts in Cluster

Get-Cluster “Cluster Name” | Get-VMHost | ForEach-Object {

$esxcli = Get-EsxCli -VMHost $_

$esxcli.storage.nmp.satp.set($null,”VMW_PSP_RR”,”VMW_SATP_DEFAULT_AA”)

}

 

 2nd Method-> Manually 
 Log in vCenter and then Select Host and click on one host> configuration tab > storage > click on one data store > properties > manage paths > and check path selection > here select Round robin and click on change then click on close.