Setting the Storage Path Policy

Submitted by jbredehoeft on Tue, 12/06/2011 - 17:16

This article is pretty much a reminder for me, and I hope useful for other people. I am always setting the preferred storage path from the default to Round Robin. I do this in two ways: the first is to log into the ESX console, or the "hidden" ESXi console and set the default to round robin; the second is to use a powershell script to make sure that all of the datastores are set to round robin.

Here's the command/process for the first method via the console. You of course have to log onto the console, then run the following command (from ESXi you will have to get into the hidden console):

# esxcli nmp satp setdefaultpsp --satp VMW_SATP_SYMM --psp VMW_PSP_RR

With the exception of esxcli all of this comes from the VMware Pluggable Storage Architecture (PSA), we are addressing the 3 layers of PSA, Multipathing Layers > SATP Layers > PSP layers.

esxcli = is the command line interface
nmp = Native Multipath Plugin
satp = Storage Array Type Plugin
psp = Path Selection Plugin.
VMW_SATP_SYMM = is placeholder for EMC Symmetric, which is the storage I am using. There are others; for instance
You will need to use the specific SATP for your storage vendor.
VMW_PSP_RR = Specifies RoundRobin. You can also set

You can do the same thing with a power cli script, here is an example of the script I use:

# Connect to the vSphere Server
Connect-VIServer vsphere-server
# Enumerate through each host in a cluster or a single host
foreach ($hostx in get-vmhost "single-host or cluster-name") {
$hostview = Get-View $hostx
# Gets a view of all the storage
$storageSystem = Get-View $hostview.ConfigManager.StorageSystem
# Create an Object to set the policy
$policy = new-object VMware.Vim.HostMultipathInfoLogicalUnitPolicy
# Define the policy method, in this case Round Robin
$policy.policy = "VMW_PSP_RR"
# Apply our change.
$storageSystem.StorageDeviceInfo.MultipathInfo.lun | foreach { $storageSystem.SetMultipathLunPolicy($_.ID, $policy) }