PowerCLI Script to Change IOPS Setting for XIV

So this is a bit of a controversial modification to make to the hosts connecting to IBM XIV storage.  By default when using the Round Robin multipath policy in VMware (as advised for IBM XIV Storage), the path will only change after receiving 1000 IOPS.  The controversy begins around the decision to modify this setting.

Some users have experienced significant performance improvements especially when performing backups, on some storage arrays, by modifying this setting to a lower amount… some even suggest modifying this down to 1 IOP, meaning that the path would change on each IOP… I wouldn’t advise making the change to such a low level but luckily this setting has made an appearance in the IBM XIV configuration documentation, meaning that there is an advised setting for IBM XIV.  The setting advised by IBM themselves is to modify the setting down to 10 IOPS.

This modification cannot be made through the GUI in any way, that I could find, and therefore can either be done from the command line on each host to each LUN or using the following PowerCLI script to make the modification on all of your hosts in a datacenter and all of the XIV LUNs… this script can also be tweaked to be used for other storage arrays.

## Script Variables
$VC = Read-Host 'Please Enter VirtualCenter Name'
$mycluster = Read-Host 'Please Enter The Cluster Name or DataCenter'
$DiskID = "eui.001738"
### Connect to VirtualCenter
Connect-VIServer $VC | Out-Null
### Loop Through Cluster or DC to get ESXCLI instances and run commands
$esxHosts = Get-VMHost -Location $mycluster | Sort Name
foreach($esx in $esxHosts)
 ### $esxcli.system.hostname.get() ###
$esxcli = Get-EsxCli -VMHost $esx
 $esxcli.storage.nmp.device.list() | where {$_.Device -match $DiskID}| % {$esxcli.storage.nmp.psp.roundrobin.deviceconfig.set(0,$null,$_.Device,10,"iops",0) }
#Disconnect from VirtualCenter
Disconnect-VIServer $VC -Confirm:$false | Out-Null

When running this script, you are first presented with a request for the vCenter server to connect to and then the Cluster Name or Datacenter… after that it will run through all of the XIV LUNs and modify them to be set to 10 IOPS but only if their multipath policy is already configured as Round Robin.  Please also note that this script is designed to work with ESXi 5.1 as there were some modifications made to the storage configuration area between 5.0 and 5.1

If you wish to modify the actual IOP value then this is performed by changing the following line:

{$esxcli.storage.nmp.psp.roundrobin.deviceconfig.set(0,$null,$_.Device,10,"iops",0) }

The bold figure is the item that needs to be changed.

This script is modified from a VMware Community Forum post but unfortunately I cannot remember who the poster was.

About the Author


I have been in IT for the past 15 years and using virtualisation technologies for around the past 8 years. I started, as quite a lot of people do, working with PCs after playing with such iconic systems like the ZX81, ZX Spectrum and then progressing through 386s, 486s, Pentiums etc. After being headhunted at sixth form to work for a small company based around Hertfordshire, UK. I began working with small businesses and gaining a lot of hardware experience. Three years later, after helping to increase the size of the business, I needed to gain exposure to a larger environment to progress my own career. I joined a large manufacturing company around Electronic Test and Measurement which progressed my skills onto more PC work, hardware work and then onto Server Operating Systems. I progressed again onto a consultancy company based in Reading, UK. Initially working as an engineer performing hardware / software installations for larger companies contracted out to the consultancy company, I moved up into a Consultant position continuing my travel across the UK assisting and providing solutions to companies. I finally moved on again to my current position, working back in Hertfordshire, UK. Again working for a large manufacturing company, this time with over 50,000 users worldwide. I am responsible for the datacenter hardware, the storage environment, the vmware environment and also implementing their new Citrix XenApp farm. My days are busy but also productive, its a friendly environment and in my four years of being with the company, I have seen many changes in technology and infrastructure in use within the company. About the site I started this site as I had been thinking of having more of a presence on the web for a while. On a daily basis, I perform tasks and use tools that others may not use or may not think to do and therefore I thought that I would share some of these experiences and tips with others to help with their day to day work. Currently, my main focus of work is around VMware and Veeam Backup & Replication but hopefully as my tasks progress, I’ll be able to share useful bits of information about other areas of IT as well.

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.