1 2 Previous Next 19 Replies Latest reply on May 28, 2013 9:46 AM by cshells

    IOPS report

    cshells Enthusiast

      We currently just bought some new storage and I am looking for the best way to get IOPS reports from our virtual machines. More specifically I want to get the IOPS for the last quarter within the time frame of 7am-6pm. We are currently on vSphere 4.1. A good majority are View desktops, so thats why I want to look more specifically at business hours. Any ideas? Thanks!

        • 1. Re: IOPS report
          pfuhli Expert

          You could do that with vCOps.

          1 person found this helpful
          • 2. Re: IOPS report
            cshells Enthusiast

            Currently we dont have vCOps. So I was hoping there were some other options. Thanks for the response though!

            • 3. Re: IOPS report
              dchrist2 Lurker

              How exactly do you do that in vCops?  The tool is powerful but the gui needs work.....hard to find what you need.

               

              How would I find total/average IOPS per cluster over a specific time frame?

              • 4. Re: IOPS report
                mcowger Champion

                If you aren't already running a performance reporting tool, you wont be able to gather this.  This information isn't kept for that long in vCenter's DB - this level of data is usually only kept for about 24 hrs by defualt.

                • 5. Re: IOPS report
                  pfuhli Expert

                  There are several ways to get a view on the data.

                   

                  One might be:

                  - in the vsphere gui

                  - select the object you want to report on (on the left site of the gui)

                  - go to the analysis tab

                  - set the focus to storage

                  - see which heat maps are available to suit you needs

                  - there should be a few which might help you out

                  - build you own heat map, if you need other corelations

                  - heatmaps do not give you a historical view

                   

                  for historical views you might:

                  - go to the vsphere gui

                  - select the object you want to report on (on the left site of the gui)

                  - select the planning tab

                  - select summary

                  - see which storage related metrics over time you can view

                   

                  or

                  - go to the vsphere gui

                  - select the object you want to report on (on the left site of the gui)

                  - select the operations tab

                  - select the all metrics button

                  - choose from the whole range of metrics (you need to double click on the metric to let ot appear on the right site of the screen in a diagram)

                  - you also can corelate/combine metrics in this metric charts view

                   

                  HTH

                   

                  daniel

                  • 6. Re: IOPS report
                    MKguy Virtuoso

                    Here is a quick and (really) dirty powershell way providing the average and maximum read and write IOPS over a custom period of days:

                    $daysback = -30
                    $vms = Get-VM
                    write-host ( "{0,-40}`t{1,8}`t{2,8}`t{3,8}`t{4,8}" -f "VM", "W IOPS avg", "R IOPS avg", "W IOPS max", "R IOPS max" ) `
                    ; $vms | sort | % {
                      $wval = (((Get-Stat $_ -stat "datastore.numberWriteAveraged.average" -Start (Get-Date).adddays($daysback) -Finish (Get-Date) ) | select -expandproperty Value)  | measure -average -max);
                      $rval = (((Get-Stat $_ -stat "datastore.numberReadAveraged.average" -Start (Get-Date).adddays($daysback) -Finish (Get-Date) ) | select -expandproperty Value)  | measure -average -max);
                      write-host ( "{0,-40}`t{1,8:N2}`t{2,8:N2}`t{3,8:N2}`t{4,8:N2}" -f $_.Name, $wval.average, $rval.average, $wval.maximum, $rval.maximum )
                    }

                     

                    Output is like:

                    VM                                         W IOPS avg    R IOPS avg  W IOPS max  R IOPS max
                    VM1                                                1,96            0,67            7,00           31,00
                    VM2                                                0,46            0,53            7,00           17,00
                    VM3                                                7,57            7,66           52,00           73,00
                    VM4                                                3,47            0,00             4,00            0,00
                    [...]

                     

                     

                    Be aware that historic performance data is rolled up in the vCenter DB. So if you query data from the last 30 days like in this example, the values are made up of 2 hour averages rolled up in the DB. Especially the peak values may look a little low then. Go with -1 (dailly, 1 minute averages) or -7 (weekly, 30 minute averages) in that case and run it periodically.

                     

                     

                    Here is also a version that will only evaluate values with a timestamp between 07:00 - 18:30:

                    $daysback = -30
                    $vms = Get-VM
                    write-host ( "{0,-40}`t{1,8}`t{2,8}`t{3,8}`t{4,8}" -f "VM", "W IOPS avg", "R IOPS avg", "W IOPS max", "R IOPS max" ) `
                    ; $vms | sort | % {
                      $wval = (((Get-Stat $_ -stat "datastore.numberWriteAveraged.average" -Start (Get-Date).adddays($daysback) -Finish (Get-Date) ) | ? {$_.Timestamp.ToString() -match ' (0[7-9]|1[0-8]):'} | select -expandproperty Value)  | measure -average -max);
                      $rval = (((Get-Stat $_ -stat "datastore.numberReadAveraged.average" -Start (Get-Date).adddays($daysback) -Finish (Get-Date) ) | ? {$_.Timestamp.ToString() -match ' (0[7-9]|1[0-8]):'} | select -expandproperty Value)  | measure -average -max);
                      write-host ( "{0,-40}`t{1,8:N2}`t{2,8:N2}`t{3,8:N2}`t{4,8:N2}" -f $_.Name, $wval.average, $rval.average, $wval.maximum, $rval.maximum )
                    }
                    • 7. Re: IOPS report
                      cshells Enthusiast

                      MKguy,

                       

                      I apologize for such a late response. Had some surgery and was out for awhile. Thanks for the powershell script. I will try this out. I think the second script is exactly what I am looking for. Do you know how far back you can query?

                      • 8. Re: IOPS report
                        cshells Enthusiast

                        MKguy,

                         

                        So I ran this script today and I am getting an error. The metric counter "datastore.numberwriteaverage.average" doesn't exist for entity.

                         

                        Do different versions of vSphere store this statistic different?

                        • 9. Re: IOPS report
                          MKguy Virtuoso

                          Oh right, seems like you've ran into the same problem as I was after upgrading from 4.1 to 5.0. VMware removed the per-VM IOPS counters from the default vCenter statistics collection levels, so your vCenter database does not store any historical data about them anymore.

                           

                          You can change this behaviour as described in this post:

                          http://alpacapowered.wordpress.com/2012/12/17/control-vcenter-performance-counter-collection-and-get-back-vm-iops-statistics/

                           

                          Unfortunately for you, this means you don't have any access to past data on a per-VM basis. You would need to either start from scratch after making the changes above and wait until you get some amount of samples you're comfortable with, or refer to host-level total counters.

                          The latter could be quite skewed and inaccurate however, due to non-VM generated IO like StoragevMotions, cloning operations or things like VAAI.

                          1 person found this helpful
                          • 10. Re: IOPS report
                            cshells Enthusiast

                            Actually, we are a 4.1 environment. So I am not sure why it is giving me that error. I have tried to pull numberwrite, numberread, and I get the same error with everything.So I can see these stats on the performance tab for my VMs in real-time, but does it keep historical data for this?

                            • 11. Re: IOPS report
                              MKguy Virtuoso

                              If in the vSphere Client you only see real-time metrics of the last hour for any given counter, then no, vCenter does not store these metrics.

                               

                              I'm not sure if VMware incorporated that into a later 4.1 Update too. First, check the statistics collection level in the vSphere Client under Administration->vCenter Server Settings->Statistics

                               

                              Download the LevelMappingUtility.zip file from http://kb.vmware.com/kb/2009532

                              Connect to your vCenter in PowerCLI and execute the following:

                              Import-Module D:\VMware.VimAutomation.PowerCliExtensions.CounterLevelMapping.psm1

                               

                              Get-PxCounterLevelMapping | ? {$_.Name -match "datastore.number(Read|Write)Averaged.average" }

                               

                              Post the output. The PerDeviceLevel number for these metrics is probably higher than the statistics collection level specified in the vCenter settings, meaning historical data won't be stored at all.

                              • 12. Re: IOPS report
                                cshells Enthusiast

                                Quick question, importing this module doesn't do anything to vCenter correct? I see in the KB you can make changes, but I assume if you don't configure it, it won't have any affect by importing it into vCenter.

                                • 13. Re: IOPS report
                                  mcowger Champion

                                  Correct - its just importing to your Powershell instance.

                                  • 14. Re: IOPS report
                                    cshells Enthusiast

                                    Thanks guys!

                                     

                                    I ran that command and here is the output.

                                     

                                    Logging.PNG

                                    1 2 Previous Next