How to Change the HBA Queue Depth on VMware ESXi?

PowerADM.com / Virtualization / VMware / How to Change the HBA Queue Depth on VMware ESXi?

Before changing the HBA queue depth settings on a VMware ESXi host, check which HBA module is loaded. Connect to your ESXi server via SSH and run the command:

  • for QLogic:
    # esxcli system module list | grep qla
  • for Emulex:
    # esxcli system module list | grep lpfc

Depending on the installed HBA module (qla or lpfc), you can change the queue depth with the following commands:

  • QLogic:
    # esxcli system module parameters set -p ql2xmaxqdepth=128 -m qla2xxx
  • Emulex:
     # esxcli system module parameters set -p lpfc0_lun_queue_depth=128 -m lpfcххх

In this example, I set the queue depth to 128 (set the queue depth value depending on the recommendations of your storage array vendor).

Also, you can change HBA queue depth using PowerCLI. Install the VMware vSphere PowerCLI module on your computer and connect to the ESXi host (or vCenter server):

Install-Module -Name VMware.PowerCLI
Connect-VIServer your_host_name

Check which HBA module is loaded (similar to the esxcli system module list | grep lpfc command):

$esxcli = Get-EsxCli -VMhost hq-esx01 -V2
$List = $esxcli.system.module.parameters.list.CreateArgs()
$List.module = ‘lpfc’
$esxcli.system.module.parameters.list.Invoke($List)

The command returned that the value of the lpfc_lun_queue_depth parameter = 128 (Max number of FCP commands we can queue to a specific LUN). This means that an Emulex adapter with a queue depth of 128 is being used.

powershell get hba queue depth on vmware esxi

To reduce the queue depth to 64, run the following PowerShell commands:

$Parameters = $esxcli.system.module.parameters.set.CreateArgs()
$Parameters.module = ‘lpfc’
$Parameters.parameterstring = ‘lpfc_lun_queue_depth=64’
$esxcli.system.module.parameters.set.Invoke($Parameters)

powercli - set queue_depth

Reboot the ESXi host to apply the changes.

Leave a Reply

Your email address will not be published. Required fields are marked *