Memory Ballooning

vorgusa

Well-Known Member
Oct 28, 2009
37
0
46
Hi, I was looking into trying out memory ballooning on Proxmox using a ubuntu 10.04 Guest. I am using the most recent Proxmox 1.5 with 2.6.32 Kernel. I saw on another post that I should be able to use the balloon command in qemu to get this to work but I get an error message:

"The balloon device has not been activated by the guest"

I have read in multiple threads on other sites, like the one below, that
"-balloon virtio" needs to be added to the qemu command line, I assume
this is the startup command for the guest, so I checked and I do not see it.
Will this be added in the future? and is there an easy way for me to do this
now?

http://kerneltrap.org/mailarchive/linux-kvm/2010/1/4/6256406/thread
 
Does it works on Proxmox? is it possible to use this feature on Linux and Windows guests?
It does. You must remember that memory you assigned during VM creation is maximum you can assign using balooning.
 
I've enabled memory ballooning on many of my VMs but it didn't increase the total free memory of my server at all,
 
I've enabled memory ballooning on many of my VMs but it didn't increase the total free memory of my server at all,

Why would it? KSM can free some memory, ballooning only allows to change memory size for kvm guest without guest restart.
 
i'm lost...
and what about ksm? I believed it was in charge of that automatically?
 
Why would it? KSM can free some memory, ballooning only allows to change memory size for kvm guest without guest restart.
Due to this page in wiki : http://pve.proxmox.com/wiki/Memory_Ballooning
Memory ballooning (KVM only) allows you to have your guest dynamically change it’s memory usage by evicting unused memory during run time. It reduces the impact your guest can have on memory usage of your host by giving up unused memory back to the host.
Acctually it worked on Linux guests but no impact on Windows Guests,
 
Due to this page in wiki : http://pve.proxmox.com/wiki/Memory_Ballooning
Memory ballooning (KVM only) allows you to have your guest dynamically change it’s memory usage by evicting unused memory during run time. It reduces the impact your guest can have on memory usage of your host by giving up unused memory back to the host.
Acctually it worked on Linux guests but no impact on Windows Guests,

Description is a little misleading as it can suggests that there is some automated process which can reduce the amount of memory the guest is using, while it simply allows You to tell to Your guest that You are adding or removing some memory from him, that's all. Yes, You can free unused guest memory but only if You do it manually. Guest needs to support this and that means that You can use it only with linux guests (AFAIK).
 
i'm lost...
and what about ksm? I believed it was in charge of that automatically?
I believe KSM only merge pages of memory that contains the same data, so for example two Windows XP VM will use only one loaded kernel on memory.
 
Description is a little misleading as it can suggests that there is some automated process which can reduce the amount of memory the guest is using, while it simply allows You to tell to Your guest that You are adding or removing some memory from him, that's all. Yes, You can free unused guest memory but only if You do it manually. Guest needs to support this and that means that You can use it only with linux guests (AFAIK).
I've activate memory ballooning on many of my Linux VMs, so how can I ask my VMs to free the unused memory?
 
I've activate memory ballooning on many of my Linux VMs, so how can I ask my VMs to free the unused memory?

Open monitor tab and enter "balloon <memory_size>", where memory size is the new amount of memory You want to allocate to Your guest. For example if You had 1024MB allocated to Your guest and You decided that You want to change that to 600MB as Your guest is not using it, enter "balloon 600".
 
running qm info get me this error:
using KVM without synchronous MMU, ballooning disabled,
and balloon 600 has no impact on guest or host
 
I added -balloon virtio to the args: option, and its working fine... Could this be added by default by proxmox? Earlier versions of KVM had it enabled by default but it seems 0.12.x now needs this option.

Also, balloon only lets you decrease the available memory in a guest... Would it be possible to have 2 memory options on each image, a boot memory (ie what available when the system first boots) and a max memory so you can increase the available memory on an image if required?
 
I added -balloon virtio to the args: option, and its working fine... Could this be added by default by proxmox? Earlier versions of KVM had it enabled by default but it seems 0.12.x now needs this option.

Also, balloon only lets you decrease the available memory in a guest... Would it be possible to have 2 memory options on each image, a boot memory (ie what available when the system first boots) and a max memory so you can increase the available memory on an image if required?
What's your proxmox version?
 
Also, balloon only lets you decrease the available memory in a guest... Would it be possible to have 2 memory options on each image, a boot memory (ie what available when the system first boots) and a max memory so you can increase the available memory on an image if required?

Please can you describe how the balloon options helps saving memory - for it loojks like a manual process, so it is not suitable for production use. Or is there a way to automate this?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!