VMware {code} Community
muthumia
Enthusiast
Enthusiast

CPU Daily Average & Guest Memory % counter

Hi,

I am working in VI_SDK in java in VC2.0 and ESX 3.0 environment.

Is it possible to get the daily average directly from the database for the performance counters?

example, daily (last one day) average for CPU usage, Mem usage ,etc.. (which use to show in Virtual Infrastructure Client GUI).

2. I also want to get Guest memory usage . Is it possible to get this value using VI SDK ?? if doesnt make sense, how to collect this data??

any immediate help will serve a great to me..

Thanks in advance..

Reply
0 Kudos
4 Replies
admin
Immortal
Immortal

Answer to your second question, the guest memory usage can be determined through the sdk.

If we access Managed object VirtualMachine, check it's properties summary>quickStats>guestMemoryUsage, we should land with the Guest memory utilization statistics, in MB.

Reply
0 Kudos
hrobinson
VMware Employee
VMware Employee

The Guest Memory usage is retrieved as 'mem.active.average' performance counter. This provides the usage in KB over the sample period.

Reply
0 Kudos
muthumia
Enthusiast
Enthusiast

Thanks a lot for the replies.

VI Client GUI use to provide a Guest Mem %.

How to get this value?

guestMemoryUsage can be get from VirtualMachine->Summary->QuickStats object.

What is the total value in order to get the guest memory % shows in GUI.

Reply
0 Kudos
hrobinson
VMware Employee
VMware Employee

The formula to calculate the percentage is:

(mem.active.average/1024) / VirtualMachine.config.hardware.memoryMB

mem.active is store in KB, so you need to divide by 1024 to match the units.

Of course, you'll get a number between 0 and 1 and so ...

The quickStats is just a sampled measure of that setting.

H

Reply
0 Kudos