VMware {code} Community
MikeHandsome
Contributor
Contributor

VI SDK JAVA - Get CPU and MEM from Host/VM

Hello together,

i succesfully installed the VISDK and can run all the examples. It works fine.

Now i try to develop some small Java application that just returns the actual Host CPU and Memory Usage and the actual VM CPU and Memory Usage (of one certain VM).

I did not find any simple samples that help me to connect to the Host and get these values.

Can anyone of you give me a sample or a clue how to start?

Thank you for your help.

Mike

Reply
0 Kudos
2 Replies
lamw
Community Manager
Community Manager

To get the Host CPU/Mem usage, you'll need to get a reference to your HostSystem and take a look at hostSystem->summary->quickStats http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.host.Summary.QuickStat...

To get the VM CPU/Mem usage, you can either pass in a specific VM and get it's reference or traverse the VirtualMachine MoRef array from a host object and take a look at virtualMachine->summary->quickStats http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.vm.Summary.QuickStats....

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

If you find this information useful, please award points for "correct" or "helpful".

MikeHandsome
Contributor
Contributor

Oh, thank you!

I'll try to get my Informations this way.

I already realised it now using the VI Perl Toolkit. It makes less trouble with setting up. It's very slow i try to speed it up.

Thanx, Mike

Reply
0 Kudos