Automation

 View Only
  • 1.  Get-stat counter not available

    Posted Nov 03, 2009 04:27 PM

    I'm trying to run following line

    Get-vm TestVM | get-stat -stat mem.swapused.kilobytes

    but get error

    Get-Stat : 03/11/2009 16:10:49 Get-Stat The metric counter "mem.swapused.kilobytes" doesn't exist for entity "TestVM".

    At line:1 char:9

    + Get-stat <<<< -entity (get-vm svr-sccm-cdc01) -stat mem.swapused.kilobytes -IntervalMins 5

    + CategoryInfo : ResourceUnavailable: (:smileyhappy: , VimException

    + FullyQualifiedErrorId : Client20_RuntimeDataServiceImpl_CheckUserMetrics_MetricDoesntExist,VMware.VimAutomation.Commands.GetViStats

    the stats level in VC is 2 and I can see this stats through VI client. Also if i run Get-TKEperformanceCounter form the Community Extensions this stat is listed for the VM.

    I can see level 1 type stats like

    get-vm testvm | get-stat -stat mem.usage.average

    I'm running PowerCli 4 162509

    thanks.



  • 2.  RE: Get-stat counter not available

    Posted Nov 03, 2009 04:51 PM

    Afaik, there is no metric named mem.swapused.kilobytes.

    Where do you see this in the VIC ?

    If you go into and slect Memory you should look at the Internal Name and Rollup columns to determine the metric.

    The only ones I know of are: swapped, swaptarget, swapin and swapout (for a VM) and the rollup is minimum, maximum or average (depending on the statistics level you specified for the interval)



  • 3.  RE: Get-stat counter not available

    Posted Nov 04, 2009 09:22 AM

    ok thanks that makes sense, I was looking at the results of Get-TKEPerformanceCounters which showed this stat for the entity. I'd got my counters mixed up when looking in VC.

    what does this funtion show then? counters available through VC rather than powerCli?



  • 4.  RE: Get-stat counter not available

    Posted Nov 04, 2009 10:10 AM

    The Get-TKEPerformanceCounter function returns correct results.

    You just have to take care when composing your metric.

    Use this order: Group,Name,RollupType

    But note that not all metrics are available for all entities.

    To see the available metrics for a specific entity you can use my script in and use the -QueryMetrics parameter.



  • 5.  RE: Get-stat counter not available

    Posted Nov 04, 2009 01:35 PM

    ok thanks Luc, but if i run:

    get-vmhost testVMHost | get-stat -stat disk.deviceWriteLatency.average -realtime

    i get an error then the performance data follows.

    Get-Stat : 04/11/2009 13:29:14 Get-Stat The metric counter "disk.devicewritelatency.average" doesn't exist fo

    r entity "svr-vmh-crcla07.lbcamden.net".

    At line:1 char:51

    + get-vmhost testVMHost | get-stat <<<< -stat disk.deviceWriteLatency.average -realtime

    + CategoryInfo : ResourceUnavailable: (:smileyhappy: , VimException

    + FullyQualifiedErrorId : Client20_RuntimeDataServiceImpl_CheckUserMetrics_MetricDoesntExist,VMware.VimAutomation.

    Commands.GetViStats

    MetricId Timestamp Value Unit

    -


    -


    -


    -


    disk.deviceWriteLatenc... 04/11/2009 13:29:10 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:28:50 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:28:30 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:28:10 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:27:50 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:27:30 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:27:10 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:26:50 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:26:30 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:26:10 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:25:50 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:25:30 3 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:25:10 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:24:50 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:24:30 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:24:10 2 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:23:50 1 millise...

    disk.deviceWriteLatenc... 04/11/2009 13:23:30 1 millise...

    any ideas?



  • 6.  RE: Get-stat counter not available
    Best Answer

    Posted Nov 04, 2009 01:44 PM

    That is a known "feature" in the current PowerCLI build.

    You get the error message but also the values.

    See also Yavor's reply in



  • 7.  RE: Get-stat counter not available

    Posted Nov 04, 2009 02:06 PM

    ha! thats funny it was me who started that thread

    thanks for your help anyway.



  • 8.  RE: Get-stat counter not available

    Posted Nov 20, 2009 09:34 AM

    Hi all,

    The problem that was causing errors to be thrown for some of the metrics was addressed in the newly released version of PowerCLI - 4.0 Update 1. Give it a try and I'll be happy to get further feedback in case you still experience some problems in the specified cases!

    \Yavor