PowerCLI

 View Only
  • 1.  get-stat-realtime_powercli

    Posted Dec 14, 2018 12:00 PM

    Hi Luc,

    i try to check one vm for average memory usage through get-stat

    i found

    while i checked the smethingthrough task manger

    can you suggest something why these two dont match .

    currently iam using reltime in get-stat.



  • 2.  RE: get-stat-realtime_powercli

    Posted Dec 14, 2018 12:35 PM

    Let me try to explain in a couple of lines.
    A more detailed explanation would most probably take a couple of page or a compete chapter in a book :smileygrin:

    • the Get-Stat cmdlet retrieves metrics from the PerformanceManager. That means from the outside (through the hypervisor).
    • the mem.usage metric is a ratio of the active memory over the configured memory.
    • the active memory number is estimated by the VMKernel (the hypervisor) based on the number of memory pages actively used during the measurement interval (20 seconds for Realtime)
    • the memory percentage the Task manager shows is obtained inside the guest OS
    • this also contains for example parts of the memory that the OS reserved uses for caching
    • the amount the OS acquires for caching is relative to the total physical memory and what part of that physical memory is free
    • the difference between 'actively used' and 'obtained', which is not necessarily used during the TaskManager measurement interval, is what most likely causes the different numbers you see

    I hope this clarifies a bit



  • 3.  RE: get-stat-realtime_powercli

    Posted Dec 14, 2018 12:56 PM

    i got most of it :smileyhappy:

    is there any way from powerclito get below (without changing stats level  but in realtime)

    "the memory percentage the Task manager shows is obtained inside the guest OS "



  • 4.  RE: get-stat-realtime_powercli

    Posted Dec 14, 2018 01:03 PM

    You mean a shorter interval than 20 seconds?

    If yes, that can be done with Get-EsxTop which uses by default a 5 second interval (but which is a bit more cumbersome to work with).

    If you mean the performance metrics as the Task Manager shows, then you would need to look at the Get-Counter cmdlet.

    This is not a PowerCLI cmdlet and needs to connect to the target over the network (which assumes such a connection exists) or needs to be run inside the Guest OS (think Invoke-VMScript).



  • 5.  RE: get-stat-realtime_powercli

    Posted Dec 14, 2018 01:16 PM

    i mean 20 seconds only as real time for get-stat is for 20seconds only(i think this is corect)

    let me check get-counter .



  • 6.  RE: get-stat-realtime_powercli
    Best Answer

    Posted Dec 14, 2018 01:18 PM

    Yes, the Realtime interval is a 20 seconds interval.