1 2 3 Previous Next 38 Replies Latest reply on Feb 10, 2011 6:19 AM by mvoss18

    How to configure IOPS with powerCLI

    Flapoly Enthusiast

      in fact I do not know how to Set/Get the IOPS parameter of a lun.Can you help me ?

       

      In summary I would like to translate the following scripts to powershell.  If you are able to provide how to access to IOPS I'll take care of the loop separetly...

       

      Set script

      for i in `ls /vmfs/devices/disks/ | grep naa.600` ; do esxcli nmp roundrobin setconfig --type "iops" --iops=1 --device $i ;done

       

      Get Script

      for i in `ls /vmfs/devices/disks/ | grep naa.600` ; do esxcli nmp roundrobin getconfig --device $i ;done

       

       

      extra from HP best practices for EVA

      http://h20195.www2.hp.com/V2/GetPDF.aspx/4AA1-2185ENW.pdf

        • 1. Re: How to configure IOPS with powerCLI
          LucD Guru
          User ModeratorsCommunity WarriorsvExpert

          I'm afraid that is not possible (yet).

          See also How to do this via PowerCLI "esxcli nmp roundrobin setconfig...." ?

           

           

           

           

          ____________

          Blog: LucD notes

          Twitter: lucd22

          1 person found this helpful
          • 2. Re: How to configure IOPS with powerCLI
            Flapoly Enthusiast

            Thks - again - to lucD for a valuable answer.

             

            - We have a large environment (several vCenter & ESXi hosts) where the whole configuration, monitoring and compliance monitoring is done with powershell (ie under windows)

            I do not see how an esxcli can be introduced with our ESXi lockdown policy...

            So in i do not think esxcli can currently make the job in our environment.

             

            PS: what do you means by "yet" does VMware will provide a solution in the next few days/week ?

            • 3. Re: How to configure IOPS with powerCLI
              LucD Guru
              vExpertCommunity WarriorsUser Moderators

              I said "yet" because the esxcli utility currently uses a non-public API for this.

              And I guess that the API could/should become public one day (especially since ESXi will be the future).

               

              The alternative, like mentioned in How to do this via PowerCLI "esxcli nmp roundrobin setconfig...." ?, is to use vMA.

              But vMA is imho not the ideal solution for shops that decided to go the PowerCLI way.

               

               

               

               

              ____________

              Blog: LucD notes

              Twitter: lucd22

              • 4. Re: How to configure IOPS with powerCLI
                joeduke Novice

                Is this now possible with the new powercli 4.1.1-33244?

                 

                for i in `esxcli nmp device list | grep ^naa.600`;
                do esxcli nmp roundrobin setconfig --type "iops" --iops=1 --device $i;
                done;

                 

                TIA

                Joe

                • 5. Re: How to configure IOPS with powerCLI
                  LucD Guru
                  User ModeratorsCommunity WarriorsvExpert

                  Sure is.

                  You could do it like this.

                   

                  Connect to the ESX server

                  Run a script similar to this

                   

                  $esxcli = Get-EsxCli
                  $esxcli.nmp.device.list() | where {$_.device -like "naa.600*"} | %{
                      $configBefore = $esxcli.nmp.roundrobin.getconfig($_.device)
                      $esxcli.nmp.roundrobin.setconfig(0,$_.device,[long]1,"iops",$false)
                      $configAfter = $esxcli.nmp.roundrobin.getconfig($_.device)

                   

                  # Uncomment the following lines if you want to report the settings before and after

                  #   $configBefore
                  #   $configAfter
                  }

                   

                  The first parameter in setconfig method is not used when the type is "iops".

                  To see the parameters and their description you can do

                   

                  $esxcli.nmp.roundrobin.help("setconfig")
                  • 6. Re: How to configure IOPS with powerCLI
                    joeduke Novice

                    looks like that worked, but the new powercli broke some other things.

                    Is there a list of commands no longer available or to what they were changed? (Attach-Baseline comes to mmind first)

                     

                    (nothing listed here: http://www.vmware.com/support/developer/PowerCLI/changelog.html#PowerCLI41U1 )

                     

                    thanks for you help!

                    Joe

                    • 7. Re: How to configure IOPS with powerCLI
                      LucD Guru
                      Community WarriorsUser ModeratorsvExpert

                      The Attach-Baseline cmdlet belongs to the Update Manager snapin.

                      Is the snapin loaded ?

                      What error do you get ?

                      It still works for me.

                      • 8. Re: How to configure IOPS with powerCLI
                        joeduke Novice

                        AHA!  I did not reload the snap in.. duh.

                         

                        thanks!
                        Joe

                        • 9. Re: How to configure IOPS with powerCLI
                          joeduke Novice

                          LucD,

                              the other day I ran the script and returned no errors (perhaps I was not paying close enough attention) but now I get plenty.

                           

                          The remote server returned an error: (500) Internal Server Error.
                          At C:\test4.ps1:26 char:53
                          +     $configBefore = $esxcli.nmp.roundrobin.getconfig <<<< ($_.device)
                              + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
                              + FullyQualifiedErrorId : MethodInvocationException

                           

                          The remote server returned an error: (500) Internal Server Error.
                          At C:\test4.ps1:27 char:37
                          +     $esxcli.nmp.roundrobin.setconfig <<<< (0,$result.device,[long]1,"iops",$
                          alse)
                              + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
                              + FullyQualifiedErrorId : MethodInvocationException

                           

                          The remote server returned an error: (500) Internal Server Error.
                          At C:\test4.ps1:28 char:52
                          +     $configAfter = $esxcli.nmp.roundrobin.getconfig <<<< ($_.device)
                              + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
                              + FullyQualifiedErrorId : MethodInvocationException

                           

                           

                          line26, char53 refers to  this command:  $configBefore = $esxcli.nmp.roundrobin.getconfig($_.device)

                          line 27, char37 refers to this command: $esxcli.nmp.roundrobin.setconfig(0,$result.device,[long]1,"iops",$false)
                          line 28, char52 refers to this command:    $configAfter = $esxcli.nmp.roundrobin.getconfig($_.device)

                           

                          It appears to me that this commnad is returing a null value $esxcli.nmp.device.list() | where {$_.device -like "naa.600*"}, but when run by itself, returns the value expected:

                           

                          Device                          : naa.600508b4000d080a0001300000ca0000
                          DeviceDisplayName               : HP Fibre Channel Disk (naa.600508b4000d080a00
                                                            01300000ca0000)
                          PathSelectionPolicy             : VMW_PSP_MRU
                          PathSelectionPolicyDeviceConfig : Current Path=vmhba1:C0:T1:L1
                          StorageArrayType                : VMW_SATP_ALUA
                          StorageArrayTypeDeviceConfig    : {implicit_support=on;explicit_support=on; exp
                                                            licit_allow=on;alua_followover=on;{TPG_id=1,T
                                                            PG_state=ANO}{TPG_id=2,TPG_state=AO}}
                          WorkingPaths                    : {vmhba1:C0:T1:L1}

                           

                           

                          any advice?

                           

                          thanks

                          Joe

                          • 10. Re: How to configure IOPS with powerCLI
                            LucD Guru
                            User ModeratorsvExpertCommunity Warriors

                            You are connected to the ESX server and not the vCenter server I assume ?

                            • 11. Re: How to configure IOPS with powerCLI
                              joeduke Novice

                              Es, I am connected to the esxhost.

                              • 12. Re: How to configure IOPS with powerCLI
                                LucD Guru
                                vExpertUser ModeratorsCommunity Warriors

                                And is that an ESX 4.x host ?

                                Note that with ESX 4.0 some commands don't work, with ESX 4.1 they should all work.

                                • 13. Re: How to configure IOPS with powerCLI
                                  joeduke Novice

                                  This is an  ESXi 4.1.0 (VMkernel 320137) host

                                  • 14. Re: How to configure IOPS with powerCLI
                                    avlieshout Expert
                                    VMware Employees

                                    This is probably because the device that you're trying to configure doesn't have the roundrobin PSP assigned.

                                     

                                    Try $esxcli.nmp.device.list(naa.xxxxxxx) to determine the active PSP for the device.

                                     

                                    Arnim

                                    1 2 3 Previous Next