[Linux Guests] virtio_balloon driver

Ramalama

Well-Known Member
Dec 26, 2020
688
128
53
35
Hi :)
The docs mention "All Linux distributions released after 2010 have the balloon kernel driver included. "
https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_memory

Google says, its activated once "you install qemu-guest-agent"

But in my findings with almost all Linux Guests, for example ubuntu 23.10, there is no ballooning driver.
At least i cant find it, not with lsmod or anything else.

The memory consumption differs greatly either, for example i have an ubuntu 23.10 vm, with an actual memory consumption of 1,5G+1,9GBuffer, it is pretty consistent!
Now if i reboot the VM, PVE reports 3,1G used memory, but after a time, like 2-3 days, PVE Reports almost the maximal amount of the memory 7,7/8G.

On another VM (3CX-SBC) the vm repots 997mb memory consumption, while PVE reports 230mb Memory Consumption....
On the next VM, which is new+deboated ubuntu, where nothing is running, the VM reports 311MB, but PVE Reports 1GB....
I can continue forever, because its all the same on all my 7 PVE Hosts...

The only working ballooning reporting is actually only with windows instances. Everything else Linux/FreeBSD is all over the place.

Maybe someone can explain me that behaviour, cause i don't understand it.
I suspect simply, that there is no working ballooning driver on Linux Guests.

Cheers
BTW: I have no issues, everything is working perfectly, and i have enough memory everywhere either.
I just want to understand the situation.
 
Last edited:
Hi,
Hi :)
The docs mention "All Linux distributions released after 2010 have the balloon kernel driver included. "
https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_memory
You can check with cat /boot/config-<XYZ>| grep BALLOON if it's activated in your current kernel configuration

Google says, its activated once "you install qemu-guest-agent"
On Windows, you need to install the relevant VirtIO driver first, I don't think it depends on the guest agent at all, it's done by the kernel via a special device.

But in my findings with almost all Linux Guests, for example ubuntu 23.10, there is no ballooning driver.
At least i cant find it, not with lsmod or anything else.
Likely it's not a module but compiled directly in. I.e. if you have CONFIG_VIRTIO_BALLOON=y rather than CONFIG_VIRTIO_BALLOON=m.

The memory consumption differs greatly either, for example i have an ubuntu 23.10 vm, with an actual memory consumption of 1,5G+1,9GBuffer, it is pretty consistent!
Now if i reboot the VM, PVE reports 3,1G used memory, but after a time, like 2-3 days, PVE Reports almost the maximal amount of the memory 7,7/8G.

On another VM (3CX-SBC) the vm repots 997mb memory consumption, while PVE reports 230mb Memory Consumption....
On the next VM, which is new+deboated ubuntu, where nothing is running, the VM reports 311MB, but PVE Reports 1GB....
I can continue forever, because its all the same on all my 7 PVE Hosts...
Well, not sure without seeing the actual situation. If I'm not mistaken it depends on KVM hardware virtualization being on, you can check in the VM Options tab. You can test ballooning by setting a specific target memory via the monitor (of course it requires the guest to actually be able to provide that much space): https://pve.proxmox.com/wiki/Dynamic_Memory_Management#Manually_ballooning_.28testing.29
 
  • Like
Reactions: Ramalama
Thank you a lot!
CONFIG_VIRTIO_BALLOON=y is indeed here "y" everywhere.

Yesterday i rebooted some VM's and tbh, it seems to be working till now, at least i cannot say for sure that it isn't working or give any qualified answer at the moment.
All the restarted VM's almost match what pve is saying, with an tolerance of ±20%

However, time will tell, i will look at it.
I would assume that the ballooning driver inside the VM, drifts somehow after a time, maybe it stops working after some days.
However, i dont want to give any missinformation, im not sure myself.

Thanks a lot Fiona for answering all my points! :)
 

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!