ESXi

 View Only
  • 1.  Automate special Setting QFullSampleSize

    Posted Aug 05, 2016 01:58 PM

    Hi There,

    do you know a way on how to set

    QFullSampleSize

    QFullThreshold

    via script or automativally?

    Controlling LUN queue depth throttling in VMware ESX/ESXi (1008113) | VMware KB

    This setting can be set individually for a device but if i have 60 Hosts and 50 LUNs i would have to set this 3000 times.

    A way to control this in the SATP Claimrule would be the easiest because this setting depends on Array Vendor and Device type.

    I don´t want to set this globally because a Host connects to different Arrays at a time.

    Regards



  • 2.  RE: Automate special Setting QFullSampleSize
    Best Answer

    Posted Aug 05, 2016 02:34 PM

    Hi,

    I wrote a few lines for you that should do the job.

    However I didn't get the chance to test it so I warmly recommend you to do a few tests on unused luns to check that it works as expected.

    You can makes tests by editing the get-vmhost to run it on one only, and the get-scsilun to run it on one lun by adding a "where canonicalname -eq ******".

    Before running any script (in general) especially when storage is involved you need to make sure it can't go nuts.

    $queuefullsamplesize =

    $queuefullthreshold =

    $Vendor =    #Vendor of your array (If you want to update all the lun on arrays of this vendor)

    Get-VMHost | ForEach-Object {

        $esxcli = get-esxcli -VMHost $_ -V2

        $arguments = $esxcli.storage.core.device.set.CreateArgs()

        $arguments.queuefullsamplesize = $queuefullsamplesize

        $arguments.queuefullthreshold = $queuefullthreshold

       

        ($_ | Get-ScsiLun -LunType disk | where vendor -eq $Vendor).CanonicalName | ForEach-Object {

            $arguments.device = $_

            $esxcli.storage.core.device.set.Invoke($arguments)

        }

    }

    I also wrote a couple useful function that I use all the time to convert Datastores to Lun names.

    It's in my modules, you're welcome to steal it :smileyhappy:

    Function Convert-DSToCanonical {

    param(

        [Parameter(Mandatory = $True,ValueFromPipeline=$True)]

        [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl[]]

        $datastore

    )

    Process {

    $datastore | ForEach-Object {

        $CanonicalName = (Get-View $_).Info.Vmfs.Extent.diskname

        $CanonicalName

    }

    }

    }

    Function Convert-CanonicalToDS {

    param(

        [string]$canonicalname

    )

    get-datastore * | ForEach-Object {

       

        IF ((Convert-DSToCanonical -datastore $_ | select -Unique) -eq $canonicalname){

            $_

        }

    }

    }



  • 3.  RE: Automate special Setting QFullSampleSize

    Posted Aug 08, 2016 08:08 AM

    Nice one,

    thank you for your effort, will try this today.

    .CreateArgs() 

    Seems to be a great function.



  • 4.  RE: Automate special Setting QFullSampleSize

    Posted Aug 08, 2016 09:08 AM