Scroll Top

How Can We Help?

PowerCLI Script for Changing PSP to Virtunet Round Robin and setting RR IOPS to 1

You are here:
< All Topics

The PowerCLI script below changes PSP of all LUNs attached to all hosts in a vCenter to the VirtuCache Round Robin PSP (VNX_PSP_RR) and sets IOPS=1 for this PSP. This script needs to be run only after you have VirtuCache installed on all hosts in that vCenter.

$vcenter = “–enter-vcenter-ip-or-dns-here–”
$username = “–enter-username-for-vcenter-here–”
$password = “–password-goes-here–”

echo “Connecting to vCenter”
Connect-VIServer -Server $vcenter -User $username -Password $password

foreach($esx in Get-VMHost){
$esxName=$esx.name
echo “Host: $esxName”
$esxcli = Get-EsxCli -VMHost $esx
$nmpdevlist = $esxcli.storage.nmp.device.list() | Where {$_.StorageArrayType -ne “VMW_SATP_LOCAL”}
foreach ($dev in $nmpdevlist) {
$devName=$dev.Device
$devPsp=$dev.PathSelectionPolicy
if ($devPsp -ne “VNX_PSP_RR”) {
echo “Changing PSP from $devPsp to VNX_PSP_RR for LUN $devName”
$esxcli.storage.nmp.device.set($null, $devName, “VNX_PSP_RR”) | Out-Null
}
echo “Setting RR IOPS to 1 for LUN $devName”
$esxcli.storage.nmp.psp.generic.deviceconfig.set($null, “type=iops,iops=1”, $dev.device) | Out-Null
}
}

Disconnect-VIServer -Server $vcenter -Confirm:$false

Table of Contents
Download Trial Contact Us