Bug 1474452 - Qemu cannot get memory statistics from ballooning driver (qom-get).
Qemu cannot get memory statistics from ballooning driver (qom-get).
Status: CLOSED NOTABUG
Product: Virtualization Tools
Classification: Community
Component: virtio-win (Show other bugs)
unspecified
x86_64 Windows
unspecified Severity urgent
: ---
: ---
Assigned To: Amnon Ilan
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-24 12:05 EDT by Shiyanov Vadim
Modified: 2017-07-31 10:10 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-25 02:47:09 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Shiyanov Vadim 2017-07-24 12:05:22 EDT
Description of problem:
Hello, first of all, I am not, actually sure, that this is a bug (however it seems to be one). I am experiencing some troubles with windows 7 VM running under qemu-kvm (managed by libvirt, created and ran mostly from virt-manager). The problem is I can use balloon:

"""
virsh # qemu-monitor-command win7 --hmp "info balloon"
balloon: actual=4096

virsh # qemu-monitor-command win7 --hmp "balloon 2048"

virsh # qemu-monitor-command win7 --hmp "info balloon"
balloon: actual=2048

virsh # qemu-monitor-command win7 --hmp "balloon 4096"

virsh # qemu-monitor-command win7 --hmp "info balloon"
balloon: actual=4096
"""

but when it comes to guest memory stats, I can only see "balloon-free" (not obtained from balloon driver) stats:

"""
virsh # dommemstat win7 --period 10

virsh # dommemstat win7
actual 4194304
last_update 1500911258
rss 4130124
"""

And last_update never changes.
As far as I know, virsh (and libvirt) only get, what qemu can obtain. So I tried using qemu tools themselves:

"""
virsh # qemu-monitor-command win7 '{ "execute": "qom-get",  "arguments": { "path": "/machine/peripheral/balloon0",  "property": "guest-stats" } }'
{"return":{"stats":{"stat-swap-out":-1,"stat-available-memory":-1,"stat-free-memory":-1,"stat-minor-faults":-1,"stat-major-faults":-1,"stat-total-memory":-1,"stat-swap-in":-1},"last-update":1500911258},"id":"libvirt-463"}
"""

Driver thinks that guest does not support any stats (but the driver seems to be working properly, hence, I am not sure that this is a bug).
Is it really true, that windows driver don't support them at all?

Note: tried reinstalling system, installing system updates (on guest of course, Linux is up to date), tried both last and last stable drivers.

Version-Release number of selected component (if applicable):
guest - windows 7
host:

"""
uname -- all
Linux arch.localhost 4.9.37-1-lts #1 SMP Wed Jul 12 19:22:39 CEST 2017 x86_64 GNU/Linux
"""

Qemu:

"""
qemu-system-x86_64 --version
QEMU emulator version 2.9.0
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
"""

Libvirt:

"""
libvirtd --version
libvirtd (libvirt) 3.5.0
"""

How reproducible:
always

Steps to Reproduce:
1. Install qemu, libvirt, virt-manager.
2. Create VM and install windows 7.
3. Install VirtIO driver in it (either all or just balloon).
4. Reboot and type commands from description.

Actual results:
Only 3 memory stats from dommemstat.

Expected results:
All 10 stats.

Additional info:
If my report is missing something, please, don't hesitate to ask for additional info.
Comment 1 Vadim Rozenfeld 2017-07-24 21:24:34 EDT
Can you check that balloon service is up and running up on your system? 
If it is, then what is the balloon driver version?

Thanks,
Vadim.
Comment 2 xiagao 2017-07-25 02:33:52 EDT
Yes,if did not install blnsrv.exe in guest. The qmp output info will like that.
{ "execute": "qom-get","arguments": {"path":"/machine/peripheral/balloon0","property":"guest-stats" } }
{"return": {"stats": {"stat-swap-out": -1, "stat-available-memory": -1, "stat-free-memory": -1, "stat-minor-faults": -1, "stat-major-faults": -1, "stat-total-memory": -1, "stat-swap-in": -1}, "last-update": 1500963304}}

after run "blnsrv.exe -i" in windows guest. The qmp output info will be like:
{ "execute": "qom-get","arguments": {"path":"/machine/peripheral/balloon0","property":"guest-stats" } }
{"return": {"stats": {"stat-swap-out": 213032960, "stat-available-memory": 724871168, "stat-free-memory": 724869120, "stat-minor-faults": 1540819, "stat-major-faults": 21126, "stat-total-memory": 3220688896, "stat-swap-in": 611061760}, "last-update": 1500963581}}
Comment 3 Shiyanov Vadim 2017-07-25 02:35:49 EDT
Hello, Vadim,

The "Balloon" service is running:

"""
sc query "Balloon" | find "STATE"
        STATE               : 4 RUNNING
"""

Driver version is 61.74.104.14000 (this one should be from the last virtio-win iso 0.1.140.1-1, I also tried last stable 0.1.126 iso).

Yours sincerely,
Vadim
Comment 4 Shiyanov Vadim 2017-07-25 02:47:09 EDT
Hello, xiagao,

Thanks, that was the problem. Please, add this to your guides about installation of VirtIO drivers (as I have never found anything like that while searching the web).
For example on redhat customer portal:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/form-Virtualization_Host_Configuration_and_Guest_Installation_Guide-Para_virtualized_drivers-Mounting_the_image_with_virt_manager.html
I will suggest adding this info in ArchWiki if you don't mind.
Also marking issue as closed, not a bug.

Thanks,
Vadim
Comment 5 xiagao 2017-07-31 10:10:18 EDT
(In reply to Shiyanov Vadim from comment #4)
> Hello, xiagao,
> 
> Thanks, that was the problem. Please, add this to your guides about
> installation of VirtIO drivers (as I have never found anything like that
> while searching the web).
> For example on redhat customer portal:
> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/
> html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/form-
> Virtualization_Host_Configuration_and_Guest_Installation_Guide-
> Para_virtualized_drivers-Mounting_the_image_with_virt_manager.html
> I will suggest adding this info in ArchWiki if you don't mind.
> Also marking issue as closed, not a bug.
> 
> Thanks,
> Vadim

Hi Vadim,

We will add it to the guide. And thanks for your testing and suggestion.

BR,
xiagao

Note You need to log in before you can comment on or make changes to this bug.