Array Setup and Networking
1752587 Members
5018 Online
108788 Solutions
New Discussion

Set VMware RoundRobin PSP through PowerCLI

 
aherbert23
Trusted Contributor

Set VMware RoundRobin PSP through PowerCLI

This script will create the rule for Nimble volumes to use the RoundRobin PSP policy and set the policy on any existing  Nimble volumes. The script will take an argument of the vCenter server or the ESX host. If it is not provided it will prompt for the host. It will then connect to the vCenter server and get the list of VM hosts. As it connects to each of the hosts it will set the RoundRobin PSP rule and then apply the policy to any of the existing Nimble volumes.

This is a much easier process than enabling SSH on every VM host and copying and pasting the code from the VMware integration guide.

For ESX 4.x hosts this script will need to be run directly against each host rather than the vCenter server.

Here is an example of the script output:

Screen Shot 2013-03-12 at 8.42.21 AM.png

EDIT: Fixed a typo that was keeping the script from setting the vCenter server variable.

EDIT 2: Changed to use IOPS=0 as the path change settings.

EDIT 3: Fixed support for ESX 5.0 hosts

EDIT 4: Updated to support ESX 4.x and direct connections to an ESX host. EsxCli sessions for 4.x hosts cannot be initiated from the vCenter server so this script will have to be initiated directly to each ESX host.

15 REPLIES 15
aherbert23
Trusted Contributor

Re: Set VMware RoundRobin PSP through PowerCLI

I just fixed a typo in the script that was keeping it from setting the vCenter server variable properly.

kevin_coster
New Member

Re: Set VMware RoundRobin PSP through PowerCLI

Hi Adam, thanks for the script, it had been on my to-do list for some time! I had a couple of issues (ESXi 5):

Only one of --psp or --default can be used

At C:\Temp\832ad4e2-7191-41c8-875c-74806bc48116.ps1:70 char:37

+       $esxcli.storage.nmp.device.set <<<< ($false, $lun.CanonicalName, "VMW_PSP_RR") | Out-Null

The method 'set' is invoked with '6' parameters, but the expected parameter count is '5'.

At C:\Temp\832ad4e2-7191-41c8-875c-74806bc48116.ps1:71 char:58

+       $esxcli.storage.nmp.psp.roundrobin.deviceconfig.set <<<< ($null, $null, $lun.CanonicalName, 0, "iops", $ null) | Out-Null

So made the following adjustments and all was well:

From:

$esxcli.storage.nmp.device.set($false, $lun.CanonicalName, "VMW_PSP_RR") | Out-Null

$esxcli.storage.nmp.psp.roundrobin.deviceconfig.set($null, $lun.CanonicalName, 0, "iops", $null) | Out-Null

To:

$esxcli.storage.nmp.device.set($null, $lun.CanonicalName, "VMW_PSP_RR") | Out-Null

$esxcli.storage.nmp.psp.roundrobin.deviceconfig.set($null, $null, $lun.CanonicalName, 0, "iops", $null) | Out-Null

aherbert23
Trusted Contributor

Re: Set VMware RoundRobin PSP through PowerCLI

Are you running 5.0?

This may be a 5.0 vs 5.1 issue. I'll do some further testing and put an additional version check in the loop. On my 5.1 lab these parameters work.

kevin_coster
New Member

Re: Set VMware RoundRobin PSP through PowerCLI

Sorry yes, should have been more specific, this was 5.0

Kind regards

Kevin

Brendan Oldham
Occasional Contributor

Re: Set VMware RoundRobin PSP through PowerCLI

Script works great, but setting IOPs to 0 results in performance degradation in my VMware environment. I opened ticket with Nimble. Hopefully, I've got something mis-configured, but I followed the best practices.

J Benway
Advisor

Re: Set VMware RoundRobin PSP through PowerCLI

Brendan Oldham did ever get this figured out?

J Benway
Advisor

Re: Set VMware RoundRobin PSP through PowerCLI

Only a sub section of the ESX servers I have in Vcenter will attach to nimble, should I just run this again each host seperately.

Does this set the host for any new nimble luns with be Round robin?

thanks,jb

aherbert23
Trusted Contributor

Re: Set VMware RoundRobin PSP through PowerCLI

This will only modify the policy for Nimble volumes. It would be safe to run against a host not connected to the Nimble array.

blaine121
New Member

Re: Set VMware RoundRobin PSP through PowerCLI

Does the change persist after a reboot? This VMware thread says there's a PowerCLI bug that requires an elaborate workaround to make the PSP change stick: Set Default PSP Round Robin ESXi 5.0U1 | VMware Communities