1 2 3 Previous Next 41 Replies Latest reply on Feb 27, 2019 3:28 AM by Touffi Go to original post
      • 15. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
        Touffi Enthusiast

        we have conducted the following tests:

         

        • performance statistics on vCenter 5.5 (win) -> OK
        • performance statistics on vCenter 6.0 (win + vcsa) -> nok
        • performance statistics on vCenter 6.7 (vcsa) -> OK

         

        We have checked the SQL Database rollup jobs, everythings are OK

        We did not make any experiments to the retain settings.

         

        As far as we can say we think that the issue is between vCenter version 6.0 and the "get-stat"-commandlet.

        • 16. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
          LucD Guru
          vExpertUser ModeratorsCommunity Warriors

          You could check if my Get-Stat2 function experiences the same issue.
          That one calls the API directly, no PowerCLI cmdlet involved.

          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 17. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
            Touffi Enthusiast

            Hi Luc,

             

            I tried your script.

            If only one vCenter is connected where is no problem at all.

            If we have multi connection  ($global:DefaultVIServers), it does not work.

            I tried to use the parameter for $vm = get-vm -Name <myvm> -server <myserver>

            no success...

            Multiconnection is mandatory for my app where I call the script.

             

            This the error I got:

            Exception calling "QueryAvailablePerfMetric" with "4" argument(s): "A specified parameter was not
            correct: entity"
            At D:\vCenter_Reporting\Get-Stat2.ps1:153 char:5
            +     $metricId = $perfMgr.QueryAvailablePerfMetric($Entity.MoRef,$null ...
            +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
                + FullyQualifiedErrorId : VimException

            -Instance parameter invalid for requested stat: cpu.usage.average.
            Valid values are:
            At D:\vCenter_Reporting\Get-Stat2.ps1:179 char:9
            +         Throw "-Instance parameter invalid for requested stat: $st.`n ...
            +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                + CategoryInfo          : OperationStopped: (-Instance param...id values are: :String) [], Runt
               imeException
                + FullyQualifiedErrorId : -Instance parameter invalid for requested stat: cpu.usage.average.
            Valid values are:

            • 18. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
              LucD Guru
              Community WarriorsUser ModeratorsvExpert

              My Get-Stat2 is not foreseen for multiple vCenter connections.
              I just referred to it so you could check if the performance data was retrieved through the function when Get-Stat seems to fail.

              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              • 20. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
                LucD Guru
                Community WarriorsvExpertUser Moderators

                First, does it return the data?

                Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                • 22. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
                  LucD Guru
                  vExpertCommunity WarriorsUser Moderators

                  Try the attached version, I added a Server parameter, which allows you to pick a specific vCenter.

                  Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                  • 23. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
                    Touffi Enthusiast

                    New script with parameter -server work fine when only one connection vCenter is in place. (collecting data is OK)

                     

                    With two vCenter connections I get an error:

                    Exception calling "QueryAvailablePerfMetric" with "4" argument(s): "A specified parameter was not
                    correct: entity"
                    At D:\vCenter_Reporting\Get-Stat2.ps1:154 char:5
                    +     $metricId = $perfMgr.QueryAvailablePerfMetric($Entity.MoRef,$null ...
                    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
                        + FullyQualifiedErrorId : VimException

                    -Instance parameter invalid for requested stat: cpu.usage.average.
                    Valid values are:
                    At D:\vCenter_Reporting\Get-Stat2.ps1:180 char:9
                    +         Throw "-Instance parameter invalid for requested stat: $st.`n ...
                    +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        + CategoryInfo          : OperationStopped: (-Instance param...id values are: :String) [], Runt
                       imeException
                        + FullyQualifiedErrorId : -Instance parameter invalid for requested stat: cpu.usage.average.
                    Valid values are:

                    • 24. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
                      LucD Guru
                      Community WarriorsvExpertUser Moderators

                      Try replacing this line

                       

                      $perfMgr = Get-View (Get-View ServiceInstance -Server $Server).content.perfManager

                       

                      with this

                       

                      $perfMgr = Get-View (Get-View ServiceInstance -Server $Server).content.perfManager -Server $server

                       

                      Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                      • 26. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
                        Touffi Enthusiast

                        another problem with date!

                        I added -start and -finish...

                         

                        Get-Stat2 : Cannot process argument transformation on parameter 'Finish'. Cannot convert value

                        "20.02.2019 13:53:57" to type "System.DateTime". Error: "String was not recognized as a valid

                        DateTime."

                        At C:\Users\a80710058\AppData\Local\Temp\Untitled175.ps1:94 char:64

                        + ... -Entity $vm -Stat $metrics -Start $StartTime -Finish $EndTime -Interv ...

                        +                                                          ~~~~~~~~

                            + CategoryInfo          : InvalidData: (:) [Get-Stat2], ParameterBindingArgumentTransformationE

                           xception

                            + FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-Stat2

                        • 27. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
                          LucD Guru
                          vExpertCommunity WarriorsUser Moderators

                          This is most probably due to your regional settings.

                          What does this show?

                           

                          (Get-Culture).DateTimeFormat

                           

                          You can in fact use any format, but then you have to tell how to parse it.

                           

                          [datetime]::ParseExact("20.02.2019 13:53:57", 'dd.MM.yyyy HH:mm:ss', $null)

                          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                          • 28. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
                            Touffi Enthusiast

                            My variables

                            $StartTime = "05.02.2019 08:53:57"

                            $EndTime = "20.02.2019 13:53:57"

                             

                            (Get-Culture).DateTimeFormat

                             

                            AMDesignator                     : vorm.

                            Calendar                         : System.Globalization.GregorianCalendar

                            DateSeparator                    : .

                            FirstDayOfWeek                   : Monday

                            CalendarWeekRule                 : FirstFourDayWeek

                            FullDateTimePattern              : dddd, d. MMMM yyyy HH:mm:ss

                            LongDatePattern                  : dddd, d. MMMM yyyy

                            LongTimePattern                  : HH:mm:ss

                            MonthDayPattern                  : d. MMMM

                            PMDesignator                     : nachm.

                            RFC1123Pattern                   : ddd, dd MMM yyyy HH':'mm':'ss 'GMT'

                            ShortDatePattern                 : dd.MM.yyyy

                            ShortTimePattern                 : HH:mm

                            SortableDateTimePattern          : yyyy'-'MM'-'dd'T'HH':'mm':'ss

                            TimeSeparator                    : :

                            UniversalSortableDateTimePattern : yyyy'-'MM'-'dd HH':'mm':'ss'Z'

                            YearMonthPattern                 : MMMM yyyy

                            AbbreviatedDayNames              : {So., Mo., Di., Mi....}

                            ShortestDayNames                 : {So., Mo., Di., Mi....}

                            DayNames                         : {Sonntag, Montag, Dienstag, Mittwoch...}

                            AbbreviatedMonthNames            : {Jan, Feb, Mär, Apr...}

                            MonthNames                       : {Januar, Februar, März, April...}

                            IsReadOnly                       : False

                            NativeCalendarName               : Gregorianischer Kalender

                            AbbreviatedMonthGenitiveNames    : {Jan., Feb., März, Apr....}

                            MonthGenitiveNames               : {Januar, Februar, März, April...}

                            • 29. Re: Performance statistics error: some metric counters doesn't exist for entity <my vm>
                              LucD Guru
                              Community WarriorsUser ModeratorsvExpert

                              Did you try the ParseExact?

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