Automation

 View Only
  • 1.  no response from get-stat

    Posted Aug 05, 2011 09:38 AM

    Hi List,

    i have a strange problem with a performance script:

    i want to get the mem.usage.average / cpu.usage.average counters from all my esxi (4.1.1) Servers

    connect-ViServer "vcenter.server.local"

    $esxHost  = get-vmhost "server.esx.local"

    get-stat -entity $esxHost -stat mem.usage.average

    ...

    On seven servers this runs fine. On one Server, i didn't get any response. No data, no exception no failure. simply nothing.

    Can anyone help me with this??

    kind regards

    Andreas



  • 2.  RE: no response from get-stat

    Posted Aug 05, 2011 11:18 AM

    First question, from where do you run the Get-Stat, from PowerGui or from the PowerCLI prompt ?

    On the PowerCLI prompt you should normally see some error messages if there is no data available.



  • 3.  RE: no response from get-stat

    Posted Aug 05, 2011 12:02 PM

    Does the following return anything on that specific server ?

    Get-Stat -Entity $esx -Stat mem.usage.average -Realtime


  • 4.  RE: no response from get-stat

    Posted Aug 05, 2011 12:22 PM

    Hi,

    the "metric Switch throws an error. But with the "-stat " AND the "realtime" switch i get data from the last hour.

    I'm doing this in the PowerCli (32 Bit / 64 Bit Win 7, both gives the same result)

    Thx

    Andreas



  • 5.  RE: no response from get-stat

    Posted Aug 05, 2011 01:20 PM

    The Metric switch was a typo, that should have been Stat.

    But the fact that the Realtime switch returns data, means the performance data is captured on the ESX(i) server.

    Now let's take the next step and see if the data is aggregated on the vCenter server.

    Does

    Get-Stat -Entity $esx -Stat mem.usage.average -IntervalSecs 300

    return any data ?

    This should return data from Historical Interval 1.



  • 6.  RE: no response from get-stat

    Posted Aug 05, 2011 06:27 PM

    Hmm,

    this returns "metric counter dosn't exist for entity ..."

    Same with the realtime Switch runs fine.

    NTP Service is running on the esxi's and the time on the esxi's is the same as on the client and on the vcenter server. (i have this kb.)

    But in my vcenter Client in the performance charts from this Host, i see on the "past Day" Tab "no data availeble". The realtime Tab shows  correct Data

    Kind regrads

    Andreas



  • 7.  RE: no response from get-stat
    Best Answer

    Posted Aug 05, 2011 06:47 PM

    Ok, that seems to indicate that the performance data is for one reason or the other not being transferred between the host and vCenter.

    If possible, can you do a remove/add for the specific host.

    You can do this from the vSphere client or use the PowerCLI cmdlets Remove-VMHost and Add-VMHost.

    The realtime statistical data is cached on the ESX(i) server for about 1 hour, after that the vCenter aggregation should kick in.

    So you should start seeing performance data, from Get-Stat or in the vSphere client, after about 1 hour.

    Btw, the guests running on that host will normally not be impacted by the remove/add.



  • 8.  RE: no response from get-stat

    Posted Aug 05, 2011 07:29 PM

    Ok,  I will try this on Monday Morning  For now  many thanks and a nice Weekend  Kind regards   Andreas



  • 9.  RE: no response from get-stat

    Posted Aug 08, 2011 11:32 AM

    Hi Luc

    many thanks, removing and adding the specific host solves my problem.

    Only to understand it right:

    the esxi host chaches the data for one hour, any other data is transfered to the VCenter, isn'it??

    kind regards

    Andreas



  • 10.  RE: no response from get-stat

    Posted Aug 08, 2011 11:38 AM

    That is correct.

    You can test this by using the Realtime parameter. It will return all data directly from the ESXi server.

    The following will display the first and the last entry from the ESXi cache.

    Get-Stat -Entity $vm -Stat cpu.usage.average -Realtime | Sort-Object -Property Timestamp | `
    Select -First 1 -Last 1

    You should see a time difference between the 2 entries of +/- 1 hour.