VMware Cloud Community
brentcochran1
Contributor
Contributor

Modifying DNSRO on individual LUNs with PCLI - vSphere 5.5

PowerCLI Masters,

I've read a few posts on how to change the DNSRO value on individual LUNs, but not much on automating the task.  We have several types of storage across many clusters and I need to gather a list of SSD luns, and increase the DNSRO on those to 256 (per the array manufacturer).  There appears to be two ways to do this, but I'm not 100% there on either.

Method 1: Get-EsxCli

     $vmhost = get-vmhost hostname

     $EsxCli = Get-EsxCli -VMHost $vmhost

     $SSDvmfsLUNs = get-scsilun -vmhost $vmhost -canonicalname "naa.624a9370*"

     foreach {$lun in $SSDvmfsLUNs) {

         $CN = $lun.canonicalname

         ## can view the setting here:

         $EsxCli.storage.device.list($CN)

         ## NoofoutstandingIOswithcompetingworlds: 32

         $EsxCli.storage.device.set(and then I don't know what to do here)

         }

Method 2: Get-ScsiLun

     $vmhost = get-vmhost hostname

     $SSDvmfsLUNs = get-scsilun -vmhost $vmhost -canonicalname "naa.624a9370*"

     foreach {$lun in $SSDvmfsLUNs) {

          ## again, I can view the setting here, but need some help changing it

          $lun.extensiondata.queuedepth

          }

I have run some get-view command and created different $spec values, but I'm not clear enough on how it works to start from scratch.

Method 3: I don't know - but I'm open to it!  Smiley Happy

Here is Duncan's write up, but I'd rather not perform the work via console or SSH session if I can help it.

vSphere 5.5 nuggets: Change Disk.SchedNumReqOutstanding per device!

Thanks in advance!

Brent

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

The Get-EsxCLI method has some help built in, just do

$esxcli.storage.core.device.set

or

$esxcli.storage.core.device.set(

It should show you the required parameters

$esxcli.storage.core.device.set(boolean defaultname, string device, string name, boolean nopersist, long queuefullsamplesize, long queuefullthreshold, long schednumreqoutstanding, string state)

The parameters correspond with what you find in the esxcli command reference

esxcli.png


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
brentcochran1
Contributor
Contributor

Thanks for the quick response Luc!

In playing with the commands a bit, it seems I need to pass all 8 values (something I've seen with all get-esxcli commands I suppose).  I'm having some issues with some of the values however.  I have the canonicalnames of the different SSD LUNs that I'll foreach through as $luncn, so i would assume that could be fed in as devicename.  So really the only values I need to feed in are device, dnsro, and maybe persistence.

I've tried feeding in the values a few different ways, but still isn't working however.

$esxcli.storage.core.device.set(

boolean defaultname: $true?

string device:

string name:

boolean nopersist: $false

long queuefullsamplesize: 0 (default value)

long queuefullthreshold: 0 (default value)

long schednumreqoutstanding: 256 (the one value i really want to set)

string state: ?? 

Reply
0 Kudos
LucD
Leadership
Leadership

Isn't the state parameter accepting the strings "on" or "off" ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
brentcochran1
Contributor
Contributor

For anyone else interested, my use case was for a specific vendor, and LUNs over 300GB in size --> increase DSNRO to '256' and this works (and persists through a reboot).

   

    $esxcli = get-esxcli $vmhost

    $purevmfsLUNs = $vmhost | get-scsilun | where {$_.vendor -eq "PURE" -and $_.capacitygb -gt "300"}
    foreach ($lun in $purevmfsLUNs) {
        $CN = $lun.canonicalname
        $EsxCli.storage.core.device.set($null,$cn,$null,$null,$null,$null,256,$on)
        }

Thanks again for the help LucD!

Reply
0 Kudos