Disable Delayed Ack for iSCSI on ESXi, not always working

May 9, 2017 5 By Allan Kjaer

Some iSCSI storage system, requires that “Delayed Ack” is disabled on the ESXi hosts, like DELL Equallogic, HPE StoreVirtual and HPE StoreServ.

If this is not done in the correct order this will not work completely as expected.

The KB from VMware says, just to disable it, and reboot, and this will work if you wan not already been running against a iSCSI target already. in that case some of the connections will continue til use Delayed Ack.

See the KB here: https://kb.vmware.com/kb/1002598

To check for this you can use this command on the ESXi host (the host must be in maintenance mode).

vmkiscsid --dump-db | grep Delayed

What you are looking for is ’node.conn[0].iscsi.DelayedAck’=’0’ This men that “Delayed Ack”, ‘0’ means that “Delayed Ack” is disabled.

Solution:

the solution is:

  • Put the host in “maintenance mode”
  • Remove all iSCSI target from the host in dynamic discover and static target, close the window
  • Rescan storage
  • Readd all dynamic discover target
  • Rescan storage

You may need to configurer Round Robin or other path setting after this.

Result:

Here is some screenshots from a test my Colleague did, he added 1 iSCSI target, from a HPE StoreVirtual.

After adding iSCSI taget, and reboot.

After disable “Delayed Ack” and before reboot.

After a reboot, there are still connections with “Delayed Ack” enabled.

After removing the dynamic discover and static target, rescan, readd the iSCSI taget again, it is fixed.

Thanks to my colleague Christian Grønbæk Møller, for doing the this test and solution.

Update:

I have made a sample PowerCLI script that removes all static and dynamic target from a host, rescans all HBAs and adds the dynamic target again. 

Connect-viserver -name <ESXi host>
#Enter maintenance mode
Get-VMHost | Set-VMHost -State Maintenance

#Get iSCSI targets
$iSCSI_targets = Get-IScsiHbaTarget

# Remove All static
foreach ($iSCSI_target in $iSCSI_targets) {
  if ($iSCSI_target.type -eq "Static") {Remove-IScsiHbaTarget $iSCSI_target -confirm:$false}
}

# Remove All dynamic
foreach ($iSCSI_target in $iSCSI_targets) {
  if ($iSCSI_target.type -eq "Send") {Remove-IScsiHbaTarget $iSCSI_target -confirm:$false}
}

#Rescan HBA
Get-VMHostStorage -RescanAllHba

$hba = Get-VMHost | Get-VMHostHba -Type iScsi | where-object {$_.model -eq "iSCSI Software Adapter"}

#Add dynamic target
foreach ($iSCSI_target in $iSCSI_targets) {
  if ($iSCSI_target.type -eq "Send") {new-IScsiHbaTarget -IScsiHba $hba -Address $iSCSI_target.address}
}

#Rescan HBA
Get-VMHostStorage -RescanAllHba

Get-VMHost | Set-VMHost -State Connected

This script does not reboot or add static target.

If you are using dynamic targets, the static targets will reappear automatically. 

Use the script at your risk, so test it before usage.

Notes:

Host profiles can not be used to fix this.

Notes 2:

If you also have hardware iSCSI adaptors on the hosts, you may also have to disable “DelpayedAck” to get all ’node.conn[0].iscsi.DelayedAck’=’0’.

Notes 3:

I found that in some cases i had to disable software iSCSI, delete the database, on the ESXi host. before starting this, put the host in maintenance mode.

Change to the iSCSI initiator configuration directory

cd /etc/vmware/vmkiscsid

From the ESXi command prompt, use the ‘esxcfg-swiscsi’ to disable the iSCSI initiator on your ESXi host

esxcfg-swiscsi -d

Delete the associated iSCSI initiator configuration file

rm -f vmkiscsid.db

That’s it.

After reboot you will have a ESXi host with a clean iSCSI configuration. Now you can go ahead and reconfigure the iSCSI initiator on your ESXi host and add any targets. remember to change “DelayedAck” before adding targets.

Remember that the information about Hardware iSCSI also is in the database, see “Notes 2”.

Please share this page if you find it usefull: