esxcli storage nmp satp rule add -s “VMW_SATP_ALUA” -P “VMW_PSP_RR” -O iops=1 -c “tpgs_on” -V “3PARdata” -M “VV” -e “HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule”
esxcli storage nmp satp set –satp=VMW_SATP_ALUA –default-psp=VMW_PSP_RR
Script to set these via Powershell / esxcli V2 on each host:
$hosts = get-vmhost
foreach ($esx in $hosts) {
$esxcli = Get-EsxCli -VMHost $esx -V2
$sAdd = $esxcli.storage.nmp.satp.rule.add.CreateArgs()
$sAdd[‘boot’] = $false
$sAdd[‘claimoption’] = ‘tpgs_on’
$sAdd[‘description’] = ‘HP 3PAR Custom Rule’
$sAdd[‘model’] = ‘VV’
$sAdd[‘psp’] = ‘VMW_PSP_RR’
$sAdd[‘pspoption’] = ‘iops=1’
$sAdd[‘satp’] = ‘VMW_SATP_ALUA’
$sAdd[‘vendor’] = ‘3PARdata’
$addResult = $esxcli.storage.nmp.satp.rule.add.Invoke($sAdd)
“” | Select @{N=’VMHost’;E={$esxcli.VMHost.Name}},
@{N=’Add_Rule’;E={$addResult}}
$tAdd = $esxcli.storage.nmp.satp.set.CreateArgs()
$tAdd[‘defaultpsp’] = ‘VMW_PSP_RR’
$tAdd[‘boot’] = $false
$tAdd[‘satp’] = ‘VMW_SATP_ALUA’
$taddResult = $esxcli.storage.nmp.satp.set.Invoke($tAdd)
“” | Select @{N=’VMHost’;E={$esxcli.VMHost.Name}},
@{N=’Add_Rule’;E={$taddResult}}
}
Example Output:
VMHost Add_Rule
—— ——–
labesxi02.lab.local true
labesxi02.lab.local Default PSP for VMW_SATP_ALUA is now VMW_PSP_RR
labesxi01.lab.local true
labesxi01.lab.local Default PSP for VMW_SATP_ALUA is now VMW_PSP_RR
Finally to audit LUNs at a later time:
PowerCLI: Check Path Fixed or Round Robin:
Get-VMHost | Get-ScsiLun -LunType “disk” | where {$_.MultipathPolicy –ne “RoundRobin” -and $_.model -like “*VV*”}| format-table VMHost,CanonicalName,MultiPathPolicy –autosize
PowerCLI: Set to Round Robin if LUN were already presented and defaulted to MRU:
Get-VMHost | Get-ScsiLun -LunType “disk” | where {$_.MultipathPolicy –ne “RoundRobin” -and $_.model -like “*VV*”}| Set-ScsiLun -MultipathPolicy “RoundRobin”
Source Blog post with LucD’s response:
https://communities.vmware.com/thread/603671
I’ve used the V2 command as they may deprecate the non V2 esxcli option in the future.