Path selection policy experience and powercli

In this post i will discuss on how to change the PSP (path selection policy) for FC luns.

The PSP determines how an ESXi host will send data to the FC storage. The default (in my scenario which is HDS) is FIXED.

FIXED is usually used for active / active array (i will not get in to details here about arrays differences) and the idea is that all paths are active but IO goes over only one of the paths. If a fail over occurs the IO will switch to one of the other paths and stay there. The problem with that policy is that the FC ports are not balanced, some of them are very utilized and some not. The other problem is that it is not best practice by VMware or HDS. The best practice is to use RoundRobin , which basically means the ESXi uses all paths and sends specific number of IO commands to each path and moves on to the next one, that way all paths are utilized.

Here is the FC ports utilization when using the FIXED psp:

This configuration can be done using the FAT / web client, but since i have too many ESXi’s and too many LUN’s i decided to go the powercli way.

At first i tried to use the set-scsilun command, and ran it on all LUN’s and ESXi’s in the cluster – something like this:

This script works well, but is very slow, each command takes about ~2 minutes. It would have taken me the whole weekend or even more just to change one of my clusters. So i decided i have to find a better way to do it, so i researched on other methods and came across the get-esxcli cmdlet , which i can to accomplish the same task but in a different way, i can change the inner loop in my script to this: