Changing existing LUNs to Round Robin on ESXi
In the following steps, I am going to show you how to set all of the VMFS Volumes (LUNs) on an ESXi Host to use the PSP known as Round Robin, using only the ESXi Shell and/or SSH. This is clearly the simplest and most direct method of changing the PSP for existing volumes, and it is available from all ESXi Hosts in every environment.
There are other ways of changing the PSP, including using the vSphere Client and setting each VMFS Volume individually or using the VMware vSphere PowerCLI and setting the PSP for all of the VMFS Volumes at once, but either of these methods may be undesirable or unusable in any given situation:
- Using the vSphere client and setting VMFS Volume PSP for each LUN individually would be extremely time-consuming if there were more than just a few ESXi Hosts or volumes.
- Some environments may not have a vCenter Server, or the vSphere PowerCLI may not be available at the time you need to change the PSP.
Determining the default PSP for an ESXi Host
In the following example, we have an ESXi Host on which all of the VMFS Volumes have been created using the Most Recently Used (MRU) PSP, which is not the best or most optimal choice for our SAN.
To begin, let’s check what the default PSP is for ALUA arrays (VMW_SATP_ALUA) for new VMFS volumes on this ESXi Host.
Run the command:
esxcli storage nmp satp list
In the first line of the output, we can see that the default PSP for ALUA Arrays is Most Recently Used (VMW_PSP_MRU), which is not correct or desirable for our SAN.
Change the default PSP for new VMFS Volumes to Round Robin.
Run the command:
esxcli storage nmp satp set --default-psp=VMW_PSP_RR --satp=VMW_SATP_ALUA
And check your success by running the command:
esxcli storage nmp satp list
Notice, the association for VMW_SATP_ALUA is now VMW_PSP_RR; or put in simpler terms, we have changed the default PSP from Most Recently Used to Round Robin for ALUA Arrays. Unfortunately, even though we changed the default PSP for the ESXi, all of the existing ESXi volumes retain their former PSP.
Changing existing VMFS volumes to use Round Robin
Esisting VMFS volumes may either be changed to Round Robin one at a time, or by using a scriptlet, we can search for all VMFS Volumes on a host, and then change them all to use Round Robin at once!
First, list all of the LUNs by running the command:
ls /vmfs/devices/disks | grep naa.600
You will see two lines for each LUN, one is the device (first 36 characters) and the other is the first partition (:1).
Because we only need to set the PSP for the device and not the partition, we will cut the first 36 characters from our grep as a variable ‘i’, and pipe the variable to the command ‘esxcli storage nmp device set –device’ and insert the cut characters ‘$i’ in place of the device name, like this:
Run the command:
for i in `ls /vmfs/devices/disks/ | grep naa.600 | cut -b 1-36` ; do esxcli storage nmp device set --device $i --psp VMW_PSP_RR;done
When complete, you will find that all of the VMFS Volumes on this ESXi Host have been switched to using the PSP Round Robin!
Hi,
Would this setting change cause an outage to any VM’s running on the existing LUNs
It ***SHOULD*** not. Nonetheless, I would prefer if ESXi Hosts were in Maintenance Mode before applying any storage settings.