4

I was wondering if there is any tools that can be used inside of a VM and is aware of working in virtualized environment. It can be little misleading using Linux top tool without regarding limits of CPU and memory setting. Maybe some interesting data can be gatherer with VMTools assist ?

user9517
  • 114,104
  • 20
  • 206
  • 289

4 Answers4

3

The only way to get these (and more) performance counters from inside a VMware guest, is by using the VMGuestLib SDK as shipped with the vmware-tools.

I wrote a python wrapper for this library, called python-vmguestlib and a tool vmguest-stats to get access to these counters. And there are now three Dstat plugins to correlate these performance counters with other system resources. It is as simple as:

dstat -c –vm-cpu -m –vm-mem –vm-mem-adv

You can find the python wrapper, the vmguest-stats tool and Dstat at:

Feedback and improvements welcomed !

Dag Wieers
  • 346
  • 2
  • 7
1

No, as of right now, the host performance is not available from the guest.

If you're going to do performance monitoring, you're going to want three statistics:

  • The host's max (like how fast the CPUs can go)
  • The needs of other guests (how many other guests are using CPU, and how much)
  • The limit of your guest (because the VMware admin can throttle your CPU down by setting limits)

Some parts of those are available at the guest level (like the host's CPU speeds) but not the other statistics.

Brent Ozar
  • 4,425
  • 17
  • 21
  • VMWare ESX host performance counters are exposed to Windows guests through Performance Monitor (via VMWare Tools), and are exposed to Linux guests in the VMWare Tools API, though I don't know of any software to monitor it. – Jason Antman Jan 30 '12 at 21:11
1

There is a Perfmon extension that VMware have made available that gives a Windows Guest OS visibility to the ESX Host performance counters - you can read about it in this blog post by VMware's Scott Drummond here.

The comments state that there is no equivalent for Linux available yet but if you have a developer handy the Guest SDK could be used to provide the same data within a Linux Guest.

Helvick
  • 19,579
  • 4
  • 37
  • 55
0

The whole point of a virtualized machine is that it's not aware that it's a virtualized machine. The hypervisors job is to abstract the underlying hardware completely away from the VM, giving the VM the impression that it is running on physical hardware. We as users (think Tron) are aware that the machine is a VM, but the kernel of the VM (aside from some optimizations specifically geared towards running as a VM) is not aware of the fact that it's a slice.

That being said it may be possible to SNMP poll the HV (this would probably be the gateway address for typical VMs) for certain tid-bits of information regarding the HV and extrapolate that. Unfortunately I don't have access to a hypervisor that I can snmpwalk so I have no way to see what's available.

d34dh0r53
  • 1,671
  • 11
  • 11