Bug 1066808

Summary: [virtio-win][balloon]guest-stats still can be seen after disable or uninstall blnsrv service
Product: Red Hat Enterprise Linux 7 Reporter: Mike Cao <bcao>
Component: virtio-winAssignee: Gal Hammer <ghammer>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: bcao, flang, ghammer, hhuang, juzhang, lijin, michen, rbalakri, sluo, virt-maint, vrozenfe
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virtio-win-prewhql-0.1-88 Doc Type: Bug Fix
Doc Text:
Cause: After disabling or uninstalling blnsrv service the guest memory statistics still can be seen. Consequence: The balloon driver cannot provide correct memory statistics without memory balloon service (blnsvr) up and running. Fix: Reset memory statistics upon disabling or uninstalling balloon service. Result: Now, the balloon driver will not report an obsolete, not updated memory statistics, if balloon service was disabled or uninstalled.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 05:33:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1131838    

Description Mike Cao 2014-02-19 07:10:38 UTC
Description of problem:


Version-Release number of selected component (if applicable):
virtio-win-1.6.8-4 
win7-32 guest
qemu-kvm-rhev-1.5.3-48.el7.x86_64
seabios-1.7.2.2-10.el7.x86_64
3.10.0-86.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Start VM with virtio-balloon-pci
CLI: /usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 2G -smp 4,cores=2,threads=1,sockets=2 -name bcao_win-7-32-netkvm -uuid `uuidgen` -rtc base=localtime,clock=host,driftfix=slew -drive file=win7-32.qcow2,if=none,media=disk,serial=aaabbbccc,werror=stop,rerror=stop,cache=none,format=qcow2,id=drive-disk0 -device ide-drive,physical_block_size=4096,bus=ide.0,unit=1,logical_block_size=512,drive=drive-disk0,id=disk0 -drive file=en_windows_7_ultimate_with_sp1_x86_dvd_u_677460.iso,if=none,media=cdrom,id=aa -device ide-drive,id=aa1,drive=aa,bootindex=1 -drive media=cdrom,if=none,id=bb -device ide-drive,id=bb1,drive=bb -netdev tap,vhost=on,id=netdev0 -device e1000,netdev=netdev0,id=nic1,mac=1a:46:11:4a:bc:7a -vnc :2 -monitor stdio -usb -device usb-tablet,id=tablet0 -global PIIX4_PM.disable_s3=0 -global PIIX_PM.disable_s4=0 -monitor unix:/tmp/tt,server,nowait -boot menu=on -device virtio-balloon-pci,id=balloon0 -qmp tcp:0:5888,server,nowai

2.enable balloon stats in qmp
{ "execute": "qom-set",
             "arguments": { "path": "/machine/peripheral/balloon0","property": "guest-stats-polling-interval", "value": 2 } }

3.do not install blnsrv 
{ "execute": "qom-get",
  "arguments": { "path": "/machine/peripheral/balloon0",
  "property": "guest-stats" } }
{"timestamp": {"seconds": 1392792235, "microseconds": 590770}, "event": "BALLOON_CHANGE", "data": {"actual": 249122816}}
{"return": {"stats": {"stat-swap-out": -1, "stat-free-memory": -1, "stat-minor-faults": -1, "stat-major-faults": -1, "stat-total-memory": -1, "stat-swap-in": -1}, "last-update": 1392792235}}

4. install blnsrv ,then recheck the guest-stats
{"return": {"stats": {"stat-swap-out": 0, "stat-free-memory": 21155840, "stat-minor-faults": 0, "stat-major-faults": 0, "stat-total-memory": 2147074048, "stat-swap-in": 0}, "last-update": 1392792261}}
{"execute":"query-balloon"}
{"return": {"actual": 1024000000}}

5.stop or uninstall blnsrv ,repeat step3

Actual results:
{"return": {"stats": {"stat-swap-out": 0, "stat-free-memory": 1905180672, "stat-minor-faults": 3234, "stat-major-faults": 4, "stat-total-memory": 2147074048, "stat-swap-in": 4}, "last-update": 1392792727}}

Expected results:
{"return": {"stats": {"stat-swap-out": -1, "stat-free-memory": -1, "stat-minor-faults": -1, "stat-major-faults": -1, "stat-total-memory": -1, "stat-swap-in": -1}, "last-update": 1392792235}}

Additional info:

Comment 2 Mike Cao 2014-02-19 07:19:35 UTC
blnsrv -p works fine 
blnsrv -s or blnsrv -u does not work fine 
blnsrv -u works fine after guest reboot

Comment 4 Gal Hammer 2014-04-06 11:08:47 UTC
When I do:

{ "execute": "qom-get",
  "arguments": { "path": "/machine/peripheral/balloon0",
  "property": "guest-stats" } }

I get:

{"error": {"class": "CommandNotFound", "desc": "The command qom-get has not been found"}}

What am I missing? Thanks.

I have a patch ready that should fix the problem but I can't verify it.

Comment 5 Mike Cao 2014-04-08 15:39:01 UTC
(In reply to Gal Hammer from comment #4)
> When I do:
> 
> { "execute": "qom-get",
>   "arguments": { "path": "/machine/peripheral/balloon0",
>   "property": "guest-stats" } }
> 
> I get:
> 
> {"error": {"class": "CommandNotFound", "desc": "The command qom-get has not
> been found"}}
> 
> What am I missing? Thanks.
> 
> I have a patch ready that should fix the problem but I can't verify it.


{"execute":"qmp_capabilities"}
{ "execute": "qom-list", 
             "arguments": { "path": "/machine/peripheral/balloon0" } }

{ "execute": "qom-set",
             "arguments": { "path": "/machine/peripheral/balloon0",
                         "property": "guest-stats-polling-interval", "value": 2 } }

Then 

{ "execute": "qom-set",
             "arguments": { "path": "/machine/peripheral/balloon0",
                         "property": "guest-stats-polling-interval", "value": 2 } }

Comment 6 Gal Hammer 2014-04-10 13:10:02 UTC
(In reply to Mike Cao from comment #5)
> (In reply to Gal Hammer from comment #4)
> > When I do:
> > 
> > { "execute": "qom-get",
> >   "arguments": { "path": "/machine/peripheral/balloon0",
> >   "property": "guest-stats" } }
> > 
> > I get:
> > 
> > {"error": {"class": "CommandNotFound", "desc": "The command qom-get has not
> > been found"}}
> > 
> > What am I missing? Thanks.
> > 
> > I have a patch ready that should fix the problem but I can't verify it.
> 
> 
> {"execute":"qmp_capabilities"}
> { "execute": "qom-list", 
>              "arguments": { "path": "/machine/peripheral/balloon0" } }
> 
> { "execute": "qom-set",
>              "arguments": { "path": "/machine/peripheral/balloon0",
>                          "property": "guest-stats-polling-interval",
> "value": 2 } }
> 
> Then 
> 
> { "execute": "qom-set",
>              "arguments": { "path": "/machine/peripheral/balloon0",
>                          "property": "guest-stats-polling-interval",
> "value": 2 } }

I still get the CommentNotFound errors:

{"execute":"qmp_capabilities"}
{ "execute": "qom-list",
             "arguments": { "path": "/machine/peripheral/balloon0" } }
{"error": {"class": "CommandNotFound", "desc": "The command qmp_capabilities has not been found"}}

{ "execute": "qom-set",
             "arguments": { "path": "/machine/peripheral/balloon0",
                         "property": "guest-stats-polling-interval", "value": 2 } }{"error": {"class": "DeviceNotFound", "desc": "Device '/machine/peripheral/balloon0' not found"}}

{"error": {"class": "DeviceNotFound", "desc": "Device '/machine/peripheral/balloon0' not found"}}

Is there anything that should be added to the command line? Execute something?

Comment 7 Mike Cao 2014-04-11 02:53:46 UTC
(In reply to Gal Hammer from comment #6)
> (In reply to Mike Cao from comment #5)
> > (In reply to Gal Hammer from comment #4)
> > > When I do:
> > > 
> > > { "execute": "qom-get",
> > >   "arguments": { "path": "/machine/peripheral/balloon0",
> > >   "property": "guest-stats" } }
> > > 
> > > I get:
> > > 
> > > {"error": {"class": "CommandNotFound", "desc": "The command qom-get has not
> > > been found"}}
> > > 
> > > What am I missing? Thanks.
> > > 
> > > I have a patch ready that should fix the problem but I can't verify it.
> > 
> > 
> > {"execute":"qmp_capabilities"}
> > { "execute": "qom-list", 
> >              "arguments": { "path": "/machine/peripheral/balloon0" } }
> > 
> > { "execute": "qom-set",
> >              "arguments": { "path": "/machine/peripheral/balloon0",
> >                          "property": "guest-stats-polling-interval",
> > "value": 2 } }
> > 
> > Then 
> > 
> > { "execute": "qom-set",
> >              "arguments": { "path": "/machine/peripheral/balloon0",
> >                          "property": "guest-stats-polling-interval",
> > "value": 2 } }
> 
> I still get the CommentNotFound errors:
> 
> {"execute":"qmp_capabilities"}
> { "execute": "qom-list",
>              "arguments": { "path": "/machine/peripheral/balloon0" } }
> {"error": {"class": "CommandNotFound", "desc": "The command qmp_capabilities
> has not been found"}}
> 
> { "execute": "qom-set",
>              "arguments": { "path": "/machine/peripheral/balloon0",
>                          "property": "guest-stats-polling-interval",
> "value": 2 } }{"error": {"class": "DeviceNotFound", "desc": "Device
> '/machine/peripheral/balloon0' not found"}}
> 
> {"error": {"class": "DeviceNotFound", "desc": "Device
> '/machine/peripheral/balloon0' not found"}}
> 
> Is there anything that should be added to the command line? Execute
> something?

Did you add -device virtio-balloon-pci,id=balloon0 ?
I think id=balloon0 is a must  .Attach the stracth build I will help to verify it  If it still does not work to you ,

Mike

Comment 9 Gal Hammer 2014-04-27 08:57:24 UTC
(In reply to Mike Cao from comment #7)

> Did you add -device virtio-balloon-pci,id=balloon0 ?
> I think id=balloon0 is a must  .Attach the stracth build I will help to
> verify it  If it still does not work to you ,

Thanks! The problem was with my command line.

A patch was posted.

Comment 10 Mike Cao 2014-07-22 07:23:48 UTC
Retest this issue on virito-win-prewhql-87 

Steps same as comment #0

Actual Results:

After uninstall/disable blnsrv service ,
It still shows {"return": {"stats": {"stat-swap-out": 0, "stat-free-memory": 1681137664, "stat-minor-faults": 3787, "stat-major-faults": 16, "stat-total-memory": 2147074048, "stat-swap-in": 16}, "last-update": 1406013617}}

Based on above ,this issue has not been fixed yet ,Re-assign it 


Mike

Comment 11 Gal Hammer 2014-07-24 09:25:27 UTC
I think this is a regression caused by the new implementation (commit 0dcf4e6737).

A patch was posted.

Comment 12 lijin 2014-08-21 00:57:11 UTC
reproduce this issue on virtio-win-1.6.8-4 
verify this issue on build 88 and build 89

package info:
kernel-3.10.0-133.el7.x86_64
qemu-kvm-rhev-1.5.3-60.el7ev_0.5.x86_64
seabios-1.7.5-4.el7.x86_64

steps same as comment #0

Actual Results:
on virtio-win-1.6.8-4, qmp still return the guest-stats after uninstall blnsrv as:
{"return": {"stats": {"stat-swap-out": 0, "stat-free-memory": 1720758272, "stat-minor-faults": 12, "stat-major-faults": 0, "stat-total-memory": 2147074048, "stat-swap-in": 0}, "last-update": 1408522879}}

on build 88 and build 89,after uninstall blnsrv,qmp doesn't return the guest-stats,messge as following:
{"return": {"stats": {"stat-swap-out": -1, "stat-free-memory": -1, "stat-minor-faults": -1, "stat-major-faults": -1, "stat-total-memory": -1, "stat-swap-in": -1}, "last-update": 1408522945}}

Based on above ,this issue has been fixed already.

Comment 13 Mike Cao 2014-08-21 01:15:45 UTC
Move status to Verified according to comment#12

Comment 17 errata-xmlrpc 2015-03-05 05:33:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0289.html