Cloudstack VM memory reporting

2019-07-27 Thread Ng'ang'a Kioi
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());*


Re: Cloudstack VM memory reporting

2019-07-27 Thread Anurag Awasthi
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"  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
Amadeus House, Floral Street, London  WC2E 9DPUK
@shapeblue
  
 



Re: Cloudstack VM memory reporting

2019-07-27 Thread Ng'ang'a Kioi
I'm running KVM, but I've seen the error on VMware as well.

On Sat, Jul 27, 2019, 7:10 PM Anurag Awasthi 
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"  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
> Amadeus House, Floral Street, London  WC2E 9DPUK
> @shapeblue
>
>
>
>