KVM probes do not get correct memory information
|Assignee:||Javi Fontan||% Done:|
|Category:||Drivers - Auth|
|Target version:||Release 2.2|
From mail conversation with Rangababu Chakravarthula and Shashank Rachamalla:
It looks that the problem is OpenNebula calculating available memory. For xen >= 3.2 there is a reliable way to get available memory that is calling "xm info" and getting "max_free_memory" attribute. Unfortunately for kvm or xen < 3.2 there is not such attribute. I suppose you are using kvm as you tell about "free" command.
I began analyzing the kvm IM probe that gets memory information and there is a problem on the way to get total memory. Here is how it now gets memory information:
TOTALMEMORY: runs virsh info that gets the real physical memory installed in the machine
FREEMEMORY: runs free command and gets the free column data without buffers and cache
USEDMEMORY: runs top command and gets used memory from it (this counts buffers and cache)
This is a big problem as those valus do not match one with another (I don't really know how I failed to see this before). Here is the monitoring data from a host without VMs.
As you can see it makes no sense at all. Even the TOTALMEMORY that is got from virsh info is very misleading for oned as the host linux instance does not have access to all that memory (some is consumed by the hypervisor itself) as seen calling a free command:
total used free shared buffers cached
Mem: 8193988 7819192 374796 0 64176 7473992