Hi,
I know this one should be easy but wondering how I could script this on a cluster?
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.
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
To disable VAAI using the PowerCLI:
Set-VMHostAdvancedConfiguration -VMHost Hostname -Name OptionName -Value 0
OptionName
is one of:DataMover.HardwareAcceleratedMove
DataMover.HardwareAcceleratedInit
VMFS3.HardwareAcceleratedLocking
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
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
And how could I check to see if it ran successful against a list of hosts....output to a csv or something?
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
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
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
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?
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
Thanks! Worked like a champ!