VMware PowerCLI Configure Multipath Policy

Today i  needed to configure the Multipath Policy from “Most Recently Used” to “Round Robin (VMware) on our vSphere 4.1 and HP EVA4400 environment. After reading “Configuration best practices for HP StorageWorks Enterprise Virtual Array (EVA) family and VMware vSphere 4” I decided to change the path status

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

Per host:

Get-VMhost ESXHOST | Get-ScsiLun -LunType disk
image9

Per Cluster:

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

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

Per Host:

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

image10

 

Per Cluster:
get-cluster “Cluster Name” | Get-VMHost | Get-ScsiLun -LunType disk | Where-Object {$_.MultipathPolicy -ne “RoundRobin”} | Set-ScsiLun -MultipathPolicy “RoundRobin”

Special thanks to: VMPROS