Enabling VAAI functionality in ESXi via PowerCLI

This article provides steps to enable the vStorage APIs for Array Integration (VAAI) functionality in ESXi via PowerCLI. You may want to enable these specific VAAI features if your storage arrays support these hardware acceleration features and are responding correctly to VAAI primitives.

My Environment

I help manage an IBM V7000 and a Pure Storage FA-320, both of which support these VAAI features. You should check with your storage vendor before making these VMware vSphere Advanced Configuration Changes.

About Settings

In this context, if Setting=0 the feature is disabled; if Setting=1 the feature is enabled. You may modify these scripts to also disable VAAI settings if you know your array does not support these features. You will also need to remove the -WhatIf, which is there as a precaution.

Enable VAAI DataMover.HardwareAcceleratedMove

The DataMover.HardwareAcceleratedMove option is used to copy data via Clone Blocks/Full Copy/XCOPY.

Get-VMHost | Get-AdvancedSetting -Name DataMover.HardwareAcceleratedMove | Set-AdvancedSetting -Value 1 -WhatIf

Enable VAAI DataMover.HardwareAcceleratedInit

The DataMover.HardwareAcceleratedInit option is used to zero-out disk regions via Zero Blocks/Write Same.

Get-VMHost | Get-AdvancedSetting -Name DataMover.HardwareAcceleratedInit | Set-AdvancedSetting -Value 1 -WhatIf

Enable VAAI VMFS3.HardwareAcceleratedLocking

The VMFS3.HardwareAcceleratedLocking option enables Atomic Test & Set (ATS), which is used during the creation of files on the VMFS volume.

Get-VMHost | Get-AdvancedSetting -Name VMFS3.HardwareAcceleratedLocking | Set-AdvancedSetting -Value 1 -WhatIf

Enable VAAI VMFS3.EnableBlockDelete

The VMFS3.EnableBlockDelete option frees blocks of space and informs the storage array, so that the blocks can be reclaimed.

Get-VMHost | Get-AdvancedSetting -Name VMFS3.EnableBlockDelete | Set-AdvancedSetting -Value 1 -WhatIf

Increase VAAI DataMover.MaxHWTransferSize

By default DataMover.MaxHWTransferSize is 4 MB. Increase it to 16 MB (or the maximum of your array) for faster XCOPY performance.

Get-VMHost | Get-AdvancedSetting -Name DataMover.MaxHWTransferSize | Set-AdvancedSetting -Value 16384 -WhatIf

Double Check RoundRobin MultipathPolicy

My arrays support RoundRobin MultipathPolicy. This PowerCLI command will find all LUNs that are 100 GB in size or greater (so not to change direct attached storage or optical drives) and change them to Round Robin.

Get-VMHost | Get-ScsiLun -LunType disk | Where {$.MultipathPolicy -notlike "RoundRobin"} | Where {$.CapacityGB -ge 100} | Set-Scsilun -MultiPathPolicy RoundRobin -WhatIf