VMware Cloud Community
momox1
Contributor
Contributor

modify the storage qdepth for only some few Devices,

Hello Guys,

I'm working on a script to increase the storage device qdepth in only some selected LUNs(full flash), but I'm a bit stuck on how  can I match the datatore name  containing "flash" string with the naa.

The idea is to target several vcenters.

****************

esxhost=get-vmhost

foreach ($esxhostlist in $esxhost)

{

$esxcli = Get-EsxCli -VMHost $esxhostlist.name

#this command is parsing all the devices.
$list=$esxCli.Storage.Core.device.list()|where {$_.IsLocal -eq "false" -and $_.DisplayName -match "Hitachi"}|select device,DeviceMaxQueueDepth    ##how can I target only "Platinum" datastore???

 

write-host "Setting qdepth=16 to $($esxhostlist.name)"
$list| foreach {$esxcli.storage.core.device.set($null,$null,$_.device,$null,$null,$null,4,$null,$null,$null,$null,$null,$null,$null) |Out-Null}

}

 

************

 

I appreciate your help.

0 Kudos
8 Replies
LucD
Leadership
Leadership

Can you try like this

$dsName = 'Platinum'

Get-VMHost -PipelineVariable esx |
ForEach-Object -Process {
    $esxcli = Get-EsxCli -VMHost $esx -v2
    $esxcli.storage.vmfs.extent.list.Invoke() | where{$_.VolumeName -eq $dsName}  |
    ForEach-Object -Process {
        $esxcli.storage.core.device.set.Invoke(@{device = $_.DeviceName; maxqueuedepth = 4 })
    }
}


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

0 Kudos
momox1
Contributor
Contributor

 I get the following when I try

 

Message: EsxCLI.CLIFault.summary;
InnerText: Unable to find device with name EsxCLI.CLIFault.summary
At line:6 char:9
+ $esxcli.storage.core.device.set.Invoke(@{device = $_.DeviceNa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], MethodFault
+ FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.MethodFault

0 Kudos
LucD
Leadership
Leadership

The pipeline symbol was missing, I corrected the code above


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

0 Kudos
momox1
Contributor
Contributor

Hello LucD,

 

Thank you for the answer. The script is working .I get this when I  try the put  the max qdepth per device at 16

 

Message: EsxCLI.CLIFault.summary;
InnerText: Unable to set device's max-queue-depth or current-queue-depth. Error was: Unable to complete Sysinfo operation. Please see the VMkernel log file for more details.: Bad parameterEsxCLI.CLIFault.summary
At line:6 char:9
+ $esxcli.storage.core.device.set.Invoke(@{device = $_.DeviceNa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], MethodFault
+ FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.MethodFault

 

********************* When I Look into the logs :

2021-04-28T09:19:04.861Z cpu29:2100215 opID=c74a7459)ScsiVsi: 3731: Can't set the maxPathQueueDepth value to more than device advertised maxPathQueueDepth 4

0 Kudos
momox1
Contributor
Contributor

Completing the information. I'm checking why isn't accepting 16 as the current hba's

 esxcli system module parameters list -m nfnic
Name Type Value Description
------------------------ ----- ----- -----------
ecpu_ka_timeout ulong nfnic ecpu keep alive timeout: Default = 10. Range [10 - 120] seconds. 0 to turn off.
log_throttle_count ulong nfnic log throttle count: Default = 64
lun_queue_depth_per_path ulong 16 nfnic lun queue depth per path: Default = 32. Range [1 - 1024]

0 Kudos
LucD
Leadership
Leadership

That is afaik a HW limitation, can't really change that with a script


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

0 Kudos
paudieo
VMware Employee
VMware Employee

0 Kudos
momox1
Contributor
Contributor

Yes, thank you for the links, we have to reboot some of the hosts so the hba can apply the right qdepth.

I'm wondering if there is a parameter of module where I can find the configured qdepth vs the current applied...

 

Thank you for your help.

0 Kudos