VMware Cloud Community
jvm2016
Hot Shot
Hot Shot
Jump to solution

get-stat-realtime_powercli

Hi Luc,

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

i found

pastedImage_0.png

while i checked the smethingthrough task manger

pastedImage_1.png

can you suggest something why these two dont match .

currently iam using reltime in get-stat.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Yes, the Realtime interval is a 20 seconds interval.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

5 Replies
LucD
Leadership
Leadership
Jump to solution

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

i got most of it Smiley Happy

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 "

0 Kudos
LucD
Leadership
Leadership
Jump to solution

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).


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

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 .

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, the Realtime interval is a 20 seconds interval.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference