7 Replies Latest reply on Apr 28, 2014 1:30 PM by jessem

    PowerCLI for VAAI disable

    jessem Enthusiast

      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

        • 1. Re: PowerCLI for VAAI disable
          jessem Enthusiast

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

          • 2. Re: PowerCLI for VAAI disable
            LucD Guru
            vExpertUser ModeratorsCommunity Warriors

            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: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
            • 3. Re: PowerCLI for VAAI disable
              jessem Enthusiast

              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

              • 4. Re: PowerCLI for VAAI disable
                LucD Guru
                vExpertUser ModeratorsCommunity Warriors

                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: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                • 5. Re: PowerCLI for VAAI disable
                  jessem Enthusiast

                  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?

                  • 6. Re: PowerCLI for VAAI disable
                    LucD Guru
                    Community WarriorsvExpertUser Moderators

                    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: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                    1 person found this helpful
                    • 7. Re: PowerCLI for VAAI disable
                      jessem Enthusiast

                      Thanks!  Worked like a champ!