(localcloud) SBCM5> > list virtualmachines filter=memory,memoryintfreekbs,memorykbs,memorytargetkbs,
{
"count": 3,
"virtualmachine": [
{
"memory": 512,
"memoryintfreekbs": 552836, <---
"memorykbs": 524288,
"memorytargetkbs": 524288
},
Total memory used by the process running the VM
The
memoryintfreekbsretuned by listVirtualMachines for KVM is always greater than the total memory allocated for the VM. This is because it returns the RSS of the process running the VM (https://libvirt.org/manpages/virsh.html#dommemstat)The RSS shows how much memory is allocated to that process and is in RAM. It is returned by
memoryStatsover at https://github.com/apache/cloudstack/blob/master/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java#L3712-L3718 when trying to fetch the free memory insteadNeed to discuss how to handle this as well as the impact on usage
ISSUE TYPE
CLOUDSTACK VERSION
OS / ENVIRONMENT
KVM
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS