Automatic Memory Ballooning on Windows-Based VMs with QEMU Emulator

nasr.mareza

New Member
Sep 4, 2022
3
0
1
I'm having trouble emulating a Windows VM with memory ballooning on QEMU. My investigation has led to two questions.
Just to describe my test setup:

I installed virtio ballooning driver and the ballooning service on a windows family OS and then spawned a QEMU process with 8GB RAM with the ballooning device option activated on my localhost:

-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x8

I observed that all of the assigned RAM had been allocated to the VM from the host (the entire 8G is allocated). However, the guest OS is using much less memory; around 1.5GB.

1662378946048.png

1662377288338.png


Whenever I emulate a Linux-Based VM with the same QEMU options (with the same amount of RAM), at any moment in time the Linux-Based guest OS only consumes what it currently needs which is much less than 8GB.

To make sure that the ballooning driver is not broken, I managed to connect to the memory ballooning subsystem of the windows machine via qmp.

I uploaded the windows image file on Proxmox and launched it via the panel; I saw automatic memory ballooning is working perfectly. Memory consumed via QEMU process on the host was equal to the amount of memory being consumed in the task manager of the guest OS.

My first question: how different is pve-qemu vs qemu-systemi when it comes to memory ballooning? is different from the real one or not? And how dynamic memory ballooning is handled via proxmox VE?
Second question: With what options does pve-qemu emulate a typical Windows machine?

I'm pretty sure the guest OS side configuration is OK; I'm not certain though. I think my QEMU invocation is the source of the mismatch.
My host OS is Debian 11 and the version of QEMU that I'm working is 5.2.0. Any help is much appreciated.
 

Attachments

  • 1662377260675.png
    1662377260675.png
    7.5 KB · Views: 25
Last edited:
The documentation on how ballooning works on Proxmox is here in the manual. You can manually inflate/shrink the balloon using the Monitor tab (in the Proxmox web GUI) for the VM. Using info balloon to inspect and balloon number-of-MB to change it. Note that Proxmox's dynamic memory management will (slowly) change it again after you made manual changes.
 
what do you mean ( and more details) by :
"I uploaded the windows image file on Proxmox and launched it via the panel"
and
"how different is pve-qemu vs qemu-system"
?
 
what do you mean ( and more details) by :
"I uploaded the windows image file on Proxmox and launched it via the panel"
and
"how different is pve-qemu vs qemu-system"
?
I think that the qemu process that proxmox is running had been customized in compare with the origin one. Because automatic ballooning was not supported when I execute the qemu myself. But on the proxmox panel when I launch my VM on proxmox, I saw that dynamic memory ballooning is working. and I didn't need to issue ballooning query with using qmp manualy.
 
The documentation on how ballooning works on Proxmox is here in the manual. You can manually inflate/shrink the balloon using the Monitor tab (in the Proxmox web GUI) for the VM. Using info balloon to inspect and balloon number-of-MB to change it. Note that Proxmox's dynamic memory management will (slowly) change it again after you made manual changes.
Actually, the link you mentioned doesn't answer my question properly.

My main question is how proxmox handles dynamic memory management on the backend side. Because I couldn't achieve it when I was interacting with qemu-system command line directly.
 
Last edited:

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!