This seems to be an bug if we go with documentation and your observations. I had recently also seen a bug where VMWare would always report a zero memory consumed and it was a parsing issue in ACS VMWareResource.java class which I fixed in 4.13.0. Perhaps something similar may be at play here. May be open an issue on github?
Regards, Anurag ________________________________ From: Ng'ang'a Kioi <kioie...@gmail.com> Sent: Saturday, July 27, 2019 10:23 PM To: dev@cloudstack.apache.org <dev@cloudstack.apache.org> Subject: Re: Cloudstack VM memory reporting I'm running KVM, but I've seen the error on VMware as well. On Sat, Jul 27, 2019, 7:10 PM Anurag Awasthi <anurag.awas...@shapeblue.com> wrote: > Hi Ng'ang'a Kioi, > > You are right in that these are periodically collected and stored by > StatsCollector class. What hypervisor are you working with? > > Regards, > Anurag > > On 7/27/19, 4:24 PM, "Ng'ang'a Kioi" <kioie...@gmail.com> wrote: > > Hi everyone, > > I'm trying to look at how cloudstack gathers VM statistics and > particularly > memory stats. > Looking at the list virtualmachines api, the following stats are > returned > for a sample VM > "memory": 1024, > "memoryintfreekbs": 1251804, > "memorykbs": 1048576, > "memorytargetkbs": 1048576, > > Based on the api docs > memory- the memory allocated for the virtual machine > memoryintfreekbs- the internal memory thats free in vm > memorykbs- the memory used by the vm > memorytargetkbs- the target memory in vm > > As indicated, memorykbs and memorytargetkbs cannot have the same > values. > > Looking at the codebase, it seems that these values are recieved from > the > StatsCollector class. Is this correct? If so, could the error be > originating from the below? > > *statsInMemory.setMemoryKBs(statsForCurrentIteration.getMemoryKBs());* > > *statsInMemory.setTargetMemoryKBs(statsForCurrentIteration.getTargetMemoryKBs());* > > > > anurag.awas...@shapeblue.com > www.shapeblue.com<http://www.shapeblue.com> > Amadeus House, Floral Street, London WC2E 9DPUK > @shapeblue > > > > anurag.awas...@shapeblue.com www.shapeblue.com Amadeus House, Floral Street, London WC2E 9DPUK @shapeblue