[CentOS-virt] centos6 and xen4 dom0 memory allocation

Sun Oct 23 14:51:01 UTC 2011
Peter Peltonen <peter.peltonen at gmail.com>

Hi,

On Sat, Oct 22, 2011 at 4:21 PM, Pasi Kärkkäinen <pasik at iki.fi> wrote:

>>
>> and in xend-config.sxp I have:
>>
>> (dom0-min-mem 256)
>> (enable-dom0-ballooning no)
>> (total_available_memory 0)
>>
>> Now one would think that I should have 2048M memory for dom0, right? I
>> started from there, but when starting domUs it has been reduced to
>> 1140M even though I think ballooning is disabled and there is free
>> memory available? And the weird thing is that dom0 has done some
>> swapping:
>>
>
> Did you check the amount of memory in dom0 right after boot?
> You *might* need to add also "mem=2028M" cmdline option for dom0 linux kernel (vmlinuz).

Thanks for the tip! I also googled a tip to set dom0-min-mem to the
same amount. I will try this next.


>>
>> Shutting down domUs and making more memory available does not reverse
>> the effect, dom0 does not allocate more memory.
>>
>
> dom0 is not supposed to allocate more memory!
> dom0 is a virtual machine. Free memory goes into Xen hypervisor, check with "xl info" or "xm info".

I am aware that dom0 is a virtual machine. As I reported earlier, xl info shows:

>> total_memory           : 24567
>> free_memory            : 3698
>> xen_commandline        : dom0_mem=2048M

There is free memory. Dom0 is supposed to have 2048M memory. Why is it
I have only 1140M memory in use with dom0? When I first booted the
machine I used to have 2048M memory and then Xen started reducing the
memory when I started more domUs.

So my problem is: Why is Xen reducing the amount of memory in dom0,
even I have disabled ballooning and there is more than enough memory
available for the dom0 and domUs?

Just a moment ago I experienced the following: I shut down a domU
having 4096M memory. Then I tried to start it again and Xen complained
that there is no memory available. The second restart produced the
following error:

libxl: error: libxl_dom.c:168:libxl__build_pv xc_dom_kernel_file
failed: Bad address
cannot (re-)build domain: -3

There is something fishy going around... I will now try to yum update
dom0 and domUs, set the dom0-min-mem to 2048M and reboot and see what
happens.

Best regards,
Peter