Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

For a certain job I sometimes need more memory in a DomU (CentOS 5). The trigger for the start of the job are some conditions that I can only check within that DomU: The DomU is waiting for an upload. Once it is finished it needs to process the received data - best suited would be a ram-disk.

For this scenario I have set up the DomU with a memory setting of 1 GB min and 16 GB max.

Now I am trying to find an elegant way to resize the memory to max/min from within the DomU.

The first solution for this would be using ssh from DomU to all possible Dom0s and then trigger the "xm mem-set" commands there (with sudo).

I've read some things about the xen-store. Triggers were mentioned... So this makes me think that there should be a better way. It turned out that memory balloning would be a better way.

This should work within the DomU:

echo $((4096*1024*1024)) >/proc/xen/balloon

Should resize the memory to 4 GB.

But: cat /proc/xen/ballon says:

Current allocation:  2165536 kB
Requested target:    4192256 kB
Low-mem balloon:    14611680 kB
High-mem balloon:          0 kB
Driver pages:              0 kB
Xen hard limit:      2165536 kB

Now where does that xen hard limit come from?

Result is now that my DomU has 2 GB RAM. xm list in Dom0 states that the DomU is still at 1 GB RAM...

What's going wrong here? And yes - since the DomU-version is below 3.0.4 I added "mem=16G" as kernel-boot-parameter to my DomU.

With Dom0 SLES11 SP1 (XEN 4.0.1) and CentOS 5.6 DomU (still XEN 3.0.3?) the echo 4G >/proc/xen/ballon did not do anything first - but after I did some successful xm mem-sets from the Dom0 (up to 16 GB - which worked), the /proc/xen/ballon did work within the DomU, too.

share|improve this question
1  
you can use the balloon driver that xen has with min memory and max memory ... it's all dynamic and built in –  silviud Apr 9 '11 at 22:08
    
Sounds interesting. So I just use echo 16GB (what unit do I have to use?) >/proc/xen/balloon from within the DomU an memory will just go up and vice versa? –  Nils Apr 10 '11 at 20:25
    
Silviud: Can you post your comment as answer? –  Nils Apr 11 '11 at 9:11
    
I've done some further testing today. It seem that both - the hypervisor-version and the supportet xen-version within the DomU seem to play a role here. –  Nils Apr 13 '11 at 20:43
    
My initial try was with SLES10SP3 (XEN 3.2.3) and CentOS 5.5 (Xen DomU 3.0.3). There I got the above described effect. –  Nils Apr 13 '11 at 20:53

1 Answer 1

up vote 3 down vote accepted

you can use the balloon driver that xen has with min memory and max memory ... it's all dynamic and built in

share|improve this answer
    
xen-balloning seems to be the right idea. But: It does not seem to work in all cases. –  Nils Apr 13 '11 at 20:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.