vSphere : PowerCLI Multipath Config

vSphere : PowerCLI Multipath Config

Round-robin configuration is per LUN, per host with vCenter 4.X and ESXi 4.x. When multiple hosts and datastores are in use this is a cumbersome and long-winded configuration that can easily be simplified with PowerCLI.

Single Host Configuration

Open PowerCLI and connect to a/the VCENTER server in your environment, change vcenter_name to match the hostname of your server:

connect-VIServer vcenter_name

To view hosts in a cluster, chage the cluster_name to match that in the vCenter GUI:

get-cluster cluster_name | get-vmhost

Confirm disks attached to each host:

get-cluster cluster_name| Get-VMHost | Get-ScsiLun -LunType disk

In the case of the environment I was working in I only wanted to change the configuration for EVA8400 disks attached to the VM hosts. There were also non-active/active storage devices attached which could not use round-robin.

From this you can analyse the CanonicalName and find the volumes that share the fist few digits, I ended up with all EVA8400 LUNs sharing ‘naa.6001438005’. An example output is below, you’ll note that two of the three LUNs share CanonicalName string (in red), the other does not (in green):

I had four LUNs presented from the EVA8400, so I knew this was working, I had also configured these to be RoundRobin already. This enabled quick identification that these were the correct volumes. You can use the following script to map CanonicalName to DatastoreName as per the vCenter console as can be found here: http://communities.vmware.com/message/1435173#1435173