9 Replies Latest reply on May 10, 2018 11:45 PM by LucD

    Powercli for Latency Sensitivity?

    lledarby Novice

      Just curious if anyone knows if there is a way to change the latency sensitivity setting on vSphere 5.5 vms through PowerCLI.  I have a HPC cluster and need every VM to have the setting at high.

        • 1. Re: Powercli for Latency Sensitivity?
          LucD Guru
          vExpertUser ModeratorsCommunity Warriors

          No cmdlet for that afaik, but you can try the following

           

          $vm = Get-VM -Name MyVM

          $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
          $spec.latencySensitivity = New-Object VMware.Vim.LatencySensitivity
          $spec.LatencySensitivity.Level = [VMware.Vim.LatencySensitivitySensitivityLevel]::high

          $vm.ExtensionData.ReconfigVM($spec)
          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: Powercli for Latency Sensitivity?
            sandersf Lurker

            LucD,

             

            Do you have anything for reporting on the current Latency Sensitivity setting for all VMs in a vcenter?  We haven't used this setting on too many VMs, but I want to do a check on that for about 4,000 VMs.

             

            Thanks

            Fred

            • 3. Re: Powercli for Latency Sensitivity?
              LucD Guru
              Community WarriorsvExpertUser Moderators

              Try something like this

               

              Get-View -ViewType VirtualMachine -Property Name,Config.LatencySensitivity |

              Select Name,@{N='Sensitivity Level';E={$_.Config.LatencySensitivity.Level}}

              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              • 4. Re: Powercli for Latency Sensitivity?
                Soap01 Novice

                Bringing up this thread as I am needing to find a way to automate switching this value back to 'normal' for all virtual machines in the environment. I currently have around 548 out of 5300 that have a setting of 'low' somehow. I tried the command above for a single VM (not ideal) but it returned the following error.

                 

                 

                Method invocation failed because [VMware.Vim.VirtualMachine] does not contain a method named 'reReconfigVM'.

                At line:7 char:1

                + $vm.ExtensionData.reReconfigVM($spec)

                + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

                    + FullyQualifiedErrorId : MethodNotFound

                • 5. Re: Powercli for Latency Sensitivity?
                  LucD Guru
                  User ModeratorsCommunity WarriorsvExpert

                  There is a typo in there, should read ReconfigVM (corrected it above).

                  Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                  1 person found this helpful
                  • 6. Re: Powercli for Latency Sensitivity?
                    Soap01 Novice

                    Thank you for the quick reply. I also wanted to make sure there isn't a way to apply this settings change to all VM's in the inventory regardless of current setting. (assumption is nothing will happen if already set to normal)

                    • 7. Re: Powercli for Latency Sensitivity?
                      LucD Guru
                      vExpertUser ModeratorsCommunity Warriors

                      If it is already set to 'normal', nothing will happen.

                      Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                      1 person found this helpful
                      • 8. Re: Powercli for Latency Sensitivity?
                        Soap01 Novice

                        Ok, great. Good to know.. The below code though is only going to make the change on the designated VM, how do I get it to apply across the entire VM inventory?

                         

                         

                        $vm = Get-VM -Name MyVM

                        $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
                        $spec.latencySensitivity = New-Object VMware.Vim.LatencySensitivity
                        $spec.LatencySensitivity.Level = [VMware.Vim.LatencySensitivitySensitivityLevel]::high

                        $vm.ExtensionData.ReconfigVM($spec)

                        • 9. Re: Powercli for Latency Sensitivity?
                          LucD Guru
                          Community WarriorsUser ModeratorsvExpert

                          Try like this

                           

                          $spec = New-Object VMware.Vim.VirtualMachineConfigSpec

                          $spec.latencySensitivity = New-Object VMware.Vim.LatencySensitivity

                          $spec.LatencySensitivity.Level = [VMware.Vim.LatencySensitivitySensitivityLevel]::high

                           

                          Get-VM | %{

                              $_.ExtensionData.ReconfigVM($spec)

                          }

                          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz