kvm-guest-drivers-windows
kvm-guest-drivers-windows copied to clipboard
virtio-balloon memory stats does not work along with qemu8.2
Describe the bug virtio-balloon memory stats does not work along with qemu8.2 for guest with ARM64 win11 and qemu with 8.2 version.
the virtio-win driver version is 100.100.104.26600
To Reproduce add virtio-balloon device to win11 virtual machine set memory stats interval via qemu monitor: qom-set /machine/peripheral/balloon0/virtio-backend guest-stats-polling-interval 10
look up the memory stats value: (qemu) qom-get /machine/peripheral/balloon0/virtio-backend guest-stats { "stats": { "stat-htlb-pgalloc": 18446744073709551615, "stat-swap-out": 18446744073709551615, "stat-available-memory": 18446744073709551615, "stat-htlb-pgfail": 18446744073709551615, "stat-free-memory": 18446744073709551615, "stat-minor-faults": 18446744073709551615, "stat-major-faults": 18446744073709551615, "stat-total-memory": 18446744073709551615, "stat-swap-in": 18446744073709551615, "stat-disk-caches": 18446744073709551615 }, "last-update": 1741140167 }
obvious the stats value is not correct. I have verified the linux vm with the same method, it seems work correctly.
Expected behavior A clear and concise description of what you expected to happen. look up result correct.
Screenshots If applicable, add screenshots to help explain your problem.
Host:
- Disto: [e.g. Fedora, Ubuntu, Proxmox]
- Kernel version Linux localhost 6.6.50
- QEMU version 8.2
- QEMU command line
- libvirt version
- libvirt XML file
VM:
- Windows version windows 11 home - 24H2
- Which driver has a problem balloon
- Driver version or commit hash that was used to build the driver virtio-win driver version is 100.100.104.26600
Additional context Add any other context about the problem here.
Hi @zhengbaowen , did you insure that ballon service is running in the VM?
Hi @zhengbaowen , did you insure that ballon service is running in the VM?
Hi @YanVugenfirer as my test result, the memory inflate can work well when i change the guest memory via "balloon xxxx", so i assume ballon service is running in the win11 VM?
Hi @YanVugenfirer sorry i may misunderstand you before, i made a check that the balloonservice is not running and after i install virtio-win-gt-x64.msi and make sure balloonservice run automatically, i found the memory stats query works well. thanks for your guide. moreover, i research the balloonservice and in the link of https://pve.proxmox.com/wiki/Dynamic_Memory_Management, it seems balloonservice has function of "Auto-Ballooning", does that means the windows guest can inflate and deflate the memory automatically depend on the memory real time usage?
as my observation, it seems the windows guest can not inflate and deflate the memory even if there is much free memory.
could you please help to explain this functionality?
thanks
@zhengbaowen I am not sure about auto ballooning feature. @vrozenfe does it work on Windows?
@vrozenfe could you please help to verify the "Auto-Ballooning" functionality for balloonservice?
thanks
@zhengbaowen The balloon driver itself is quite passive. It simply allocates or releases non-paged memory based on the target size. The balloon service, on the other hand, is a simple utility that collects memory statistics from the guest and sends them back to QEMU via the balloon driver.
There was an auto-ballooning project in the past, but I don't remember seeing it merged. Perhaps Proxmox implemented their own version of the auto-ballooning mechanism? However, this functionality should not be implemented inside the balloon service, but rather, in my understanding, at the host level.
By the way, are you running this on ARM64, or was that a typo?
Best, Vadim.
@zhengbaowen The balloon driver itself is quite passive. It simply allocates or releases non-paged memory based on the target size. The balloon service, on the other hand, is a simple utility that collects memory statistics from the guest and sends them back to QEMU via the balloon driver.
There was an auto-ballooning project in the past, but I don't remember seeing it merged. Perhaps Proxmox implemented their own version of the auto-ballooning mechanism? However, this functionality should not be implemented inside the balloon service, but rather, in my understanding, at the host level.
By the way, are you running this on ARM64, or was that a typo?
Best, Vadim.
Hi @vrozenfe, yes i am runing the virt type win11 VM on mobile ARM64 mobile device, so i am wondering if there is auto-balloon service in win-virt driver side, as your explanation, there is not. since i notice there is some auto-balloon work from redhat engineer for qemu and linux virt-balloon driver, but it is not merged into upstream.
so we have to do some work from host side for auto-balloon, it is strange that there is no further progress for the previous auto-balloon work.
@zhengbaowen In my understanding, auto-ballooning is quite a challenging task to implement properly, primarily because it requires sophisticated techniques to reclaim as much memory as possible from a guest without sacrificing VM performance.
Regarding my question about ARM64, I was just wondering because you mentioned that you installed virtio-win-gt-x64.msi, which is designed for x64, not ARM64. Does this mean the balloon service is operating in emulated mode?
Best, Vadim.
I have noticed that in a Debian guest on a Debian host (Raspberry Pi 4 aarch64) the virtio-balloon driver is not autoloaded on boot. It can be loaded, but doesn't seem to work: attempting to reduce memory in the virt-manager interface results in a dialog stating that this will be done on guest shutdown. It also isn't reporting memory use back to virt-manager.