Bug 1417985

Summary: Alteration in memory collection for ceilometer
Product: Red Hat OpenStack Reporter: David Peacock <dpeacock>
Component: openstack-ceilometerAssignee: Eoghan Glynn <eglynn>
Status: CLOSED WONTFIX QA Contact: Sasha Smolyak <ssmolyak>
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.0 (Liberty)CC: ealcaniz, jruzicka, mabaakou, srevivo
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-02 15:19:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Peacock 2017-01-31 14:35:31 UTC
Description of problem:

As per customer - 

~~~
The memory value provided by Ceilometer (versions Juno and Liberty) in metric memory.usage is the difference between total_memory and free_memory. We would need the total_memory minus free_memory and minus buffers_cache_memory.

Now --> memory.usage = Total_Memory - Free_Memory

Needed --> memory.commit = Total_Memory - (Free_Memory + Buffers_Cache_Memory)
~~~

How reproducible:

100%

Steps to Reproduce:
1. N/A - this is just the way ceilometer collects data from libvirt

Additional info:

Said best by Mehdi Abaakouk, this may be a non-starter from a ceilometer point of view:

~~~
I don't think you can retrieve this information without installation an
monitoring agent inside each instances. Ceilometer just uses the libvirt
API to retrieve the memory usage of instances. The libvirt reporting is
from the compute node point of view. That means; how many RAM KVM
processes really use compared to the total RAM reserved for the
instance. It doesn't known which part is really used and which part is
buffered/cached by the kernel inside the instance. For the compute/KVM
process point of view what ever the purpose, this is allocated.
~~~

Would this be an RFE for libvirt perhaps?

Comment 2 Mehdi ABAAKOUK 2017-02-02 15:19:46 UTC
This can't be a RFE for libvirt/kvm neither. From the hypervisor point of view, we can only known what memory pages are allocated by the guest operating system and those that are free.

libvirt/kvm have no idea of how the memory is managed by the guest operating system. This one can even not been Linux. That why we can't have this information via the hyperviser.