A very common practice when setting up SAN storage on a VMWare cluster is to configure the storage path policy to be set to "Round Robin" to properly benefit from MPIO in addition to standard failover. However, if the cluster consists of many nodes or there are many volumes, this can take up quite a lot of time if you configure this using the (Web)GUI. A better way to adjust the setting for the entire cluster is through PowerCLI.
The one-liner:
Get-VMHost <Cluster-or-Host> | Get-ScsiLun -LunType "disk" | Where {$_.MultipathPolicy -ne "RoundRobin"} | Set-ScsiLun -MultipathPolicy RoundRobin
The cmdlet selects a cluster or host, gets all LUNs which are of type disk (so, volumes) where the PSP has not been set to "Round Robin". On the resulting LUNs, the policy is then set to "Round Robin".
There are many variants possible with the cmdlet. You can target a single host, a set of hosts or the entire cluster by changing the name in Get-VMHost. A simple use case would be if a new ESXi host was added to the cluster and the volumes added still have the "MRU" policy enabled.
Another method to limit the policy configuration to a certain type of HBA (e.g. FC), you can do something like:
Get-VMHost | Get-VMHostHba -Type "FibreChannel" | Get-ScsiLun -LunType "disk" | where {$_.MultipathPolicy -ne "RoundRobin"} | Set-ScsiLun -MultipathPolicy RoundRobin
Other variations are possible as well, of course.
Before actually running the Set-ScsiLun portion, it is a good idea to doublecheck what will happen when running the one-liner by leaving the Set-ScsiLun part out. A list of volumes will be displayed, allowing you to verify which volumes will be changed.
« ‹ | October 2024 | › » | ||||
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |