VMware Cloud Community
jessem
Enthusiast
Enthusiast
Jump to solution

PowerCLI for VAAI disable

Hi,

I know this one should be easy but wondering how I could script this on a cluster?

Disabling VAAI using vSphere CLI or PowerCLI

To disable VAAI using the vSphere CLI:

Note: Ensure that the vSphere CLI (vCLI) is installed and is able to connect to the ESXi/ESX hosts. For more information, see the vSphere Command-Line Interface Installation and Scripting Guide.

  1. Run these vicfg-advcfg commands to change the three settings:

    vicfg-advcfg connection_options -s 0 /DataMover/HardwareAcceleratedMove
    vicfg-advcfg connection_options -s 0 /DataMover/HardwareAcceleratedInit
    vicfg-advcfg connection_options -s 0 /VMFS3/HardwareAcceleratedLocking


    Note: For more information and examples on using vCLI connection options, see the Common Options for vCLI Execution section of the vSphere Command-Line Interface Installation and Scripting Guide.

  2. Repeat this process for all the ESXi/ESX hosts connected to the storage as no reboot is required. For a production environment, ensure that you plan accordingly.

To disable VAAI using the PowerCLI:

  • Run the command:

    Set-VMHostAdvancedConfiguration -VMHost Hostname -Name OptionName -Value 0

    Where OptionName is one of:

    • DataMover.HardwareAcceleratedMove
    • DataMover.HardwareAcceleratedInit
    • VMFS3.HardwareAcceleratedLocking
    For example:

    Set-VMHostAdvancedConfiguration -VMHost (Get-VMHost ($Hosts.SelectedItem)) -Name DataMover.HardwareAcceleratedMove -Value 0

    Set-VMHostAdvancedConfiguration -VMHost (Get-VMHost ($Hosts.SelectedItem)) -Name DataMover.HardwareAcceleratedInit -Value 0

    Set-VMHostAdvancedConfiguration -VMHost (Get-VMHost ($Hosts.SelectedItem)) -Name VMFS3.HardwareAcceleratedLocking -Value 0

VMware KB: Disabling the VAAI functionality in ESXi/ESX

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

If you want to set all 3 settings in the script you should something like this

$clusterName = "MyCluster"

Get-Cluster -Name $clusterName | Get-VMHost | %{

   Get-AdvancedSetting -VMHost $_ -Name DataMover.HardwareAcceleratedMove | Set-AdvancedSetting -Value 0 -Confirm:$false

   Get-AdvancedSetting -VMHost $_ -Name DataMover.HardwareAcceleratedInit | Set-AdvancedSetting -Value 0 -Confirm:$false

   Get-AdvancedSetting -VMHost $_ -Name VMFS3.HardwareAcceleratedLocking | Set-AdvancedSetting -Value 0 -Confirm:$false

}

You keep the ESXi host in the pipe variable ($_) and call the sequence for each of the variables.

Or you could also do

$clusterName = "MyCluster"

$advSettings = "DataMover.HardwareAcceleratedMove","DataMover.HardwareAcceleratedInit","VMFS3.HardwareAcceleratedLocking"

Get-Cluster -Name $clusterName | Get-VMHost |

Get-AdvancedSetting -Name $advSettings |

Set-AdvancedSetting -Value 0 -Confirm:$false


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

View solution in original post

0 Kudos
7 Replies
jessem
Enthusiast
Enthusiast
Jump to solution

And how could I check to see if it ran successful against a list of hosts....output to a csv or something?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

To change the value on all ESXi in a cluster, you can do something like this

$clusterName = "MyCluster"

Get-Cluster -Name $clusterName | Get-VMHost |

Get-AdvancedSetting -Name DataMover.HardwareAcceleratedMove |

Set-AdvancedSetting -Value 0 -Confirm:$false

And to produce a report you could do

Get-Cluster -Name $clusterName | Get-VMHost |

Get-AdvancedSetting -Name DataMover.HardwareAcceleratedMove |

Select Entity,Name,Value |

Export-Csv report.csv -NoTypeInformation -UseCulture


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

0 Kudos
jessem
Enthusiast
Enthusiast
Jump to solution

The first change "DataMover.HardwareAcceleratedMove" worked.  However, the other 2 settings, DataMover.HardwareAcceleratedInit and Locking did not....this isn't right, is it?

$clusterName = "VMLAB 01"

Get-Cluster -Name $clusterName | Get-VMHost |

Get-AdvancedSetting -Name DataMover.HardwareAcceleratedMove |

Set-AdvancedSetting -Value 0 -Confirm:$false

Get-AdvancedSetting -Name DataMover.HardwareAcceleratedInit |

Set-AdvancedSetting -Value 0 -Confirm:$false

Get-AdvancedSetting -Name VMFS3.HardwareAcceleratedLocking |

Set-AdvancedSetting -Value 0 -Confirm:$false

0 Kudos
LucD
Leadership
Leadership
Jump to solution

If you want to set all 3 settings in the script you should something like this

$clusterName = "MyCluster"

Get-Cluster -Name $clusterName | Get-VMHost | %{

   Get-AdvancedSetting -VMHost $_ -Name DataMover.HardwareAcceleratedMove | Set-AdvancedSetting -Value 0 -Confirm:$false

   Get-AdvancedSetting -VMHost $_ -Name DataMover.HardwareAcceleratedInit | Set-AdvancedSetting -Value 0 -Confirm:$false

   Get-AdvancedSetting -VMHost $_ -Name VMFS3.HardwareAcceleratedLocking | Set-AdvancedSetting -Value 0 -Confirm:$false

}

You keep the ESXi host in the pipe variable ($_) and call the sequence for each of the variables.

Or you could also do

$clusterName = "MyCluster"

$advSettings = "DataMover.HardwareAcceleratedMove","DataMover.HardwareAcceleratedInit","VMFS3.HardwareAcceleratedLocking"

Get-Cluster -Name $clusterName | Get-VMHost |

Get-AdvancedSetting -Name $advSettings |

Set-AdvancedSetting -Value 0 -Confirm:$false


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

0 Kudos
jessem
Enthusiast
Enthusiast
Jump to solution

The second option worked flawlessly.  So now then, what should my new output to csv be to get all the options listed for all the hosts in my cluster?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Something like this

$clusterName = "MyCluster"

$advSettings = "DataMover.HardwareAcceleratedMove","DataMover.HardwareAcceleratedInit","VMFS3.HardwareAcceleratedLocking"

Get-Cluster -Name $clusterName | Get-VMHost |

Get-AdvancedSetting -Name $advSettings |

Select Entity,Name,Value |

Export-Csv report.csv -NoTypeInformation -UseCulture


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

jessem
Enthusiast
Enthusiast
Jump to solution

Thanks!  Worked like a champ!

0 Kudos