Set VMware Multipathing via PowerCLI

Query

I wanted to apply ROUND ROBIN multipathing and set IOPS to 10 (as recommended by the vendors best practices) on each datastore in my cluster using a PowerCLI command.

 

Command

First of all you can check the current multipathing

Get-Cluster {ENTER-CLUSTER-NAME} | get-vmhost | get-scsilun -CanonicalName "Naa*"

set_iscsi2

 

Then we can alter that statement to set the MultipathPolicy and CommandsToSwitchPath settings:

Get-Cluster {ENTER-CLUSTER-NAME} | get-vmhost | get-scsilun -CanonicalName "Naa*" | Set-ScsiLun -MultipathPolicy RoundRobin -CommandsToSwitchPath 10