PowerCLI: Get or Set VAAI Settings for VMware Hosts

During a recent technical engagement with a vendor, my team was asked to verify that VAAI was disabled for all hosts attached to that vCenter. There are several different ways to go about doing this, so I figured I would put this blog post together to showcase some of the different ways in which this can be accomplished. There are three settings that need to be reviewed (or changed). They are: DataMover.HardwareAcceleratedMove, DataMover.HardwareAcceleratedInit, and VMFS3.HardwareAcceleratedLocking. A value of 1 means the setting is enabled, and a value of 0 means the setting is disabled.

Via the Web Client

In the Hosts and Clusters view, select a host in the left navigation pane. In the right pane, go to the Manage tab and then the Settings sub-tab. In the middle pane, scroll down and click on Advanced System Settings. In the list of Advanced System Settings on the right pane, look for the three settings and verify (or set) the values as needed.

Via the Thick Client

In the Hosts and Clusters view, select a host in the left navigation pane. In the right pane, select the Configuration tab. In the Software section, click on Advanced Settings. In the Advanced Settings dialog that appears, click on DataMover in the left pane. Check (or set) the values for DataMover.HardwareAcceleratedMove and DataMover.HardwareAcceleratedInit.

VMware-ESXi-VAAI-ThickClient-DataMover.png

While still in the Advanced Settings dialog, in the left pane, scroll down and click on VMFS3. In the right pane, look for the VMFS3.HardwareAcceleratedLocking line and take note (or set) the value as needed.

VMware-ESXi-VAAI-ThickClient-VMFS3-HardwareAcceleratedLocking

Automation Using PowerCLI

Obviously, automating this sort of thing can definitely save a lot of time and a ton of mouse clicks (especially if you have a several hosts in a single cluster or data center)! Here are a few short PowerCLI scripts I put together that can scan (or set) your environment at either the datacenter level or the cluster level.

Get the VAAI Settings for a Data Center

This script will scan all hosts within the specified VMware Data Center object and report the VAAI settings.

# Change the $DatacenterName variable for the vCenter Datacenter you wish to check.
$DatacenterName = "Datacenter1"
$AdvancedSettings = "DataMover.HardwareAcceleratedMove","DataMover.HardwareAcceleratedInit","VMFS3.HardwareAcceleratedLocking"

# Get the VAAI Settings
Write-Host "Checking $DatacenterName. Value of 0 is Disabled; Value of 1 is Enabled."
Get-Datacenter -Name $DatacenterName | Get-VMHost | Get-AdvancedSetting -Name $AdvancedSettings | Select @{N="VM";E={$_.Entity.Name}},Name,Value | Format-Table -AutoSize

Get the VAAI Settings for a Cluster

This script will scan all hosts within the specified VMware cluster object and report the VAAI settings.

# Change the $ClusterName variable for the vCenter Cluster you wish to check.
$ClusterName = "Cluster1"
$AdvancedSettings = "DataMover.HardwareAcceleratedMove","DataMover.HardwareAcceleratedInit","VMFS3.HardwareAcceleratedLocking"

# Get the VAAI Settings
Write-Host "Checking $ClusterName. Value of 0 is Disabled; Value of 1 is Enabled."
Get-Cluster -Name $ClusterName | Get-VMHost | Get-AdvancedSetting -Name $AdvancedSettings | Select @{N="VM";E={$_.Entity.Name}},Name,Value | Format-Table -AutoSize

Set the VAAI Settings for a Data Center

This script will scan all hosts within the specified VMware Data Center object and set the VAAI settings accordingly.

# Change the $DatacenterName variable for the vCenter Datacenter you wish to set.
$DatacenterName = "Datacenter1"
$AdvancedSettings = "DataMover.HardwareAcceleratedMove","DataMover.HardwareAcceleratedInit","VMFS3.HardwareAcceleratedLocking"

# Set the VAAI settings. Be sure to validate Set-AdvancedSetting -Value (of 0 or 1) accordingly.
Write-Host "Checking $DatacenterName. Value of 0 is Disabled; Value of 1 is Enabled."
Get-Datacenter -Name $DatacenterName | Get-VMHost | Get-AdvancedSetting -Name $AdvancedSettings | Set-AdvancedSetting -Value 1 -Confirm:$false | Select @{N="VM";E={$_.Entity.Name}},Name,Value | Format-Table -AutoSize

Set the VAAI Settings for a Cluster

This script will scan all hosts within the specified VMware Cluster object and set the VAAI settings accordingly.

# Change the $ClusterName variable for the vCenter Cluster you wish to configure.
$ClusterName = "Cluster1"
$AdvancedSettings = "DataMover.HardwareAcceleratedMove","DataMover.HardwareAcceleratedInit","VMFS3.HardwareAcceleratedLocking"

# Set the VAAI settings. Be sure to validate Set-AdvancedSetting -Value (of 0 or 1) accordingly.
Write-Host "Checking $DatacenterName. Value of 0 is Disabled; Value of 1 is Enabled."
Get-Cluster -Name $ClusterName | Get-VMHost | Get-AdvancedSetting -Name $AdvancedSettings | Set-AdvancedSetting -Value 1 -Confirm:$false | Select @{N="VM";E={$_.Entity.Name}},Name,Value | Format-Table -AutoSize

I hope you’ve found this post helpful! As always, thanks for stopping by!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s