Bug 626958 - enable virtio balloon stats
enable virtio balloon stats
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
All Linux
high Severity medium
: rc
: ---
Assigned To: Luiz Capitulino
Virtualization Bugs
:
: 639534 696098 (view as bug list)
Depends On: 623903
Blocks: 782183 580953 639534 684953 756082 810856
  Show dependency treegraph
 
Reported: 2010-08-24 14:22 EDT by Dor Laor
Modified: 2014-06-17 23:12 EDT (History)
24 users (show)

See Also:
Fixed In Version: 1.4.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 623903
Environment:
Last Closed: 2014-06-13 07:49:44 EDT
Type: ---
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)
Comment 1 Luiz Capitulino 2010-09-08 13:48:08 EDT
Clearing Devel Whiteboard, as it contains information from the cloned bug.
Comment 6 Amit Shah 2011-05-30 06:33:58 EDT
*** Bug 696098 has been marked as a duplicate of this bug. ***
Comment 7 IBM Bug Proxy 2011-08-26 09:10:31 EDT
------- Comment From vahegde1@linux.vnet.ibm.com 2011-08-26 09:09 EDT-------
Hi Red Hat ,

Verified with libvirt-0.9.4-0rc1.2.el6.x86_64.rpm which is available in RHN and this issue got fixed.

Will this be included in RHEL6.2 ? can you please confirm

Thanks
Vasant
Comment 8 Luiz Capitulino 2011-08-26 13:48:44 EDT
Vasant,

What issue are you referring to? Bug 623903 has been fixed for a long time now, but the stats feature still doesn't work as far as I know.
Comment 9 IBM Bug Proxy 2011-08-29 09:30:38 EDT
------- Comment From vahegde1@linux.vnet.ibm.com 2011-08-29 09:24 EDT-------
HI Luiz  / Red Hat,
(In reply to comment #15)
> Vasant,
>
> What issue are you referring to? Bug 623903 has been fixed for a long time now,
> but the stats feature still doesn't work as far as I know.

Sorry for the confusion.
You are right. I can just see actual memory with memstat command, not complete stats.

----------------------------------------------------
virsh # dommemstat 1
actual 2097152
----------------------------------------------------

Thanks
Vasant
Comment 12 Luiz Capitulino 2011-12-09 13:23:30 EST
*** Bug 623096 has been marked as a duplicate of this bug. ***
Comment 13 Luiz Capitulino 2011-12-09 13:31:02 EST
*** Bug 639534 has been marked as a duplicate of this bug. ***
Comment 14 IBM Bug Proxy 2011-12-09 20:12:25 EST
------- Comment From pradeepkumars@in.ibm.com 2011-12-09 20:05 EDT-------
Hello Redhat

Any updates on this?
Comment 15 Luiz Capitulino 2011-12-09 20:34:09 EST
This is currently stalled upstream. We'll have to add a new QMP command for this, the most important question is whether the command will have to be asynchronous or not.

If it can be a synchronous command, then it could be added now. Otherwise, this will have to wait for the full QAPI support upstream (which will probably bring asynchronous command support). In that case this is RHEL7.0 material.
Comment 16 Luiz Capitulino 2012-01-19 11:57:32 EST
I'm reviving this one and submitted an RFC series today:

http://lists.gnu.org/archive/html/qemu-devel/2012-01/msg02478.html

The approach I'm taking with that series is to have a QMP command that sends a request to the guest and then when the guest responds the statistics is sent to the client by means of an QMP event.

Let's see what upstream thinks about it.
Comment 19 Luiz Capitulino 2012-02-17 14:27:49 EST
Anthony suggested making this a device property of virtio-balloon under QOM:

http://lists.gnu.org/archive/html/qemu-devel/2012-02/msg02390.html

The first implication is that this won't make it for 6.3, a second and more importantly implication is that QOM is likely to be 7.0 material (meaning that this feature won't be available in RHEL6).

If anyone has any objections, please say.

PS: We'll have to wait until 6.4 to know whether or not we'll have QOM for it.
Comment 23 IBM Bug Proxy 2012-05-24 00:30:55 EDT
------- Comment From pradeepkumars@in.ibm.com 2012-05-24 04:23 EDT-------
virsh dommemstat works fine in RHEL 6.3

------- Comment From pradeepkumars@in.ibm.com 2012-05-24 04:25 EDT-------
on 6.3 (2.6.32-270.el6.x86_64),

virsh # dommemstat rhel63-64-2
actual 8092456
rss 7702496

virsh #
Comment 25 Daniel Berrange 2012-05-24 15:15:18 EDT
(In reply to comment #23)
> virsh dommemstat works fine in RHEL 6.3
> on 6.3 (2.6.32-270.el6.x86_64),
> 
> virsh # dommemstat rhel63-64-2
> actual 8092456
> rss 7702496

The 'dommemstat' command can retrieve data from a number of sources, some of these are host based, others are guest based. The 'actual' and 'rss' fields are both host sourced memory stats.   The swap-in, swap-out, major-fault, minor-fault, available stats are all guest sourced via virtio-balloon.

So, yes 'dommemstat' returns data in 6.3, but this is *not* the stuff we need from virtio-balloon stats.
Comment 26 Luiz Capitulino 2012-05-24 15:18:38 EDT
(In reply to comment #25)
> (In reply to comment #23)
> > virsh dommemstat works fine in RHEL 6.3
> > on 6.3 (2.6.32-270.el6.x86_64),
> > 
> > virsh # dommemstat rhel63-64-2
> > actual 8092456
> > rss 7702496
> 
> The 'dommemstat' command can retrieve data from a number of sources, some of
> these are host based, others are guest based. The 'actual' and 'rss' fields
> are both host sourced memory stats.   The swap-in, swap-out, major-fault,
> minor-fault, available stats are all guest sourced via virtio-balloon.

Thanks for clarifying, Daniel.

> So, yes 'dommemstat' returns data in 6.3, but this is *not* the stuff we
> need from virtio-balloon stats.

Absolutely, the fact that dommemstat returns that doesn't mean we should close this bz.

This is still on my queue and should resume my work on this soon.
Comment 27 Ademar Reis 2012-07-19 19:00:55 EDT
(In reply to comment #25)
> (In reply to comment #23)
> > virsh dommemstat works fine in RHEL 6.3
> > on 6.3 (2.6.32-270.el6.x86_64),
> > 
> > virsh # dommemstat rhel63-64-2
> > actual 8092456
> > rss 7702496
> 
> The 'dommemstat' command can retrieve data from a number of sources, some of
> these are host based, others are guest based. The 'actual' and 'rss' fields
> are both host sourced memory stats.   The swap-in, swap-out, major-fault,
> minor-fault, available stats are all guest sourced via virtio-balloon.
> 
> So, yes 'dommemstat' returns data in 6.3, but this is *not* the stuff we
> need from virtio-balloon stats.

Looks like that's a source of confusion. If we don't fix the balloon stats in 6.4, we should at least document dommemstat better, to make users aware of this limitation.
Comment 28 Bhavna Sarathy 2012-07-23 13:36:12 EDT
The virtio balloon stats is disabled both upstream and in RHEL. It has always been disabled in RHEL, and so this bug is not a regression. Our plan is to implement this using QOM (qemu object model), which is currently in the works upstream.  We do not have plans to backport QOM infrastructure into RHEL6 stream as it is very intrusive, and has not stabilized upstream at.  

The title of this bug is "re-enable virtio balloon stats", but this was never enabled in RHEL6.  Adding a major feature in KVM will follow the normal upstream development and Virtualization roadmap intersections.  However, we can address any bugs that are relevant to the RHEL6.4 stream.

I recommend moving this feature request to RHEL7.
Comment 29 Luiz Capitulino 2012-07-23 16:01:35 EDT
Rename bug to 'enable virtio balloon stats', as it has never been enabled in production to be 're-enabled'.
Comment 30 IBM Bug Proxy 2012-08-27 01:10:26 EDT
------- Comment From onmahaja@in.ibm.com 2012-08-27 05:05 EDT-------
verified this on upstream setup - this still doesn't show up virtio balloon stats. Waiting until RHEL6.4 stream to check if resolution is available for this.

-- Onkar
Comment 31 Luiz Capitulino 2012-08-27 09:11:07 EDT
This hasn't being fixed upstream yet and is being targeted for RHEL7.0, which means it won't be available in RHEL6.4 either.
Comment 33 IBM Bug Proxy 2012-12-17 08:50:29 EST
------- Comment From onmahaja@in.ibm.com 2012-12-17 09:08 EDT-------
Patches for this have been posted upstream -

http://lists.gnu.org/archive/html/qemu-devel/2012-12/msg02188.html
Comment 35 Luiz Capitulino 2013-01-29 07:11:48 EST
Merged upstream (git log 58513b..045a70). The document docs/virtio-balloon-stats.txt explains how to test this feature:

http://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/virtio-balloon-stats.txt;hb=HEAD
Comment 39 langfang 2013-04-12 05:41:53 EDT
Test this bug as following version:
Host:
# uname -r
3.9.0-0.rc6.50.el7.x86_64
# rpm -q qemu-kvm
qemu-kvm-1.4.0-2.el7.x86_64

Guest:rhel7
3.9.0-0.rc6.50.el7.x86_64


Steps:
1.Boot guest with balloon device
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 

2.Tried command 

{"name": "qom-list-types"},{"name": "qom-get"}, {"name": "qom-set"}, {"name": "qom-list"},virsh dommemstat $domain

Attention:

/machine/i440fx/pci.0/child[7],the number [7] is same "addr=0x7 "

Senario 1)
{ "execute": "qom-list", 
             "arguments": { "path": "/machine/i440fx/pci.0/child[7]" } }

--->output data 

{ "execute": "qom-list-types"}--->output data

Senario 2)
*Enables polling in the specified interval (value >0)

{ "execute": "qom-set",
             "arguments": { "path": "/machine/i440fx/pci.0/child[7]",
                         "property": "guest-stats-polling-interval", "value": 2 } }
{"return": {}}

{ "execute": "qom-get",
  "arguments": { "path": "/machine/i440fx/pci.0/child[7]",
  "property": "guest-stats" } }
{"return": {"stats": {"stat-swap-out": 8192, "stat-free-memory": 453890048, "stat-minor-faults": 12087347, "stat-major-faults": 3476, "stat-total-memory": 835887104, "stat-swap-in": 0}, "last-update": 1365758588}}

{ "execute": "qom-get",
  "arguments": { "path": "/machine/i440fx/pci.0/child[7]",
  "property": "guest-stats" } }
{"return": {"stats": {"stat-swap-out": 8192, "stat-free-memory": 452493312, "stat-minor-faults": 12088549, "stat-major-faults": 3476, "stat-total-memory": 835887104, "stat-swap-in": 0}, "last-update": 1365758668}}---> the value changed

Senario 3)
*Disables polling,Previous polled statistics are still valid and can be queried.(Value =0)

{ "execute": "qom-set",
             "arguments": { "path": "/machine/i440fx/pci.0/child[7]",
			 "property": "guest-stats-polling-interval", "value": 0 } }

{ "execute": "qom-get",
  "arguments": { "path": "/machine/i440fx/pci.0/child[7]",
  "property": "guest-stats" } }
{"return": {"stats": {"stat-swap-out": 8192, "stat-free-memory": 452349952, "stat-minor-faults": 12091179, "stat-major-faults": 3476, "stat-total-memory": 835887104, "stat-swap-in": 0}, "last-update": 1365759004}}

{ "execute": "qom-get",
  "arguments": { "path": "/machine/i440fx/pci.0/child[7]",
  "property": "guest-stats" } }
{"return": {"stats": {"stat-swap-out": 8192, "stat-free-memory": 452349952, "stat-minor-faults": 12091179, "stat-major-faults": 3476, "stat-total-memory": 835887104, "stat-swap-in": 0}, "last-update": 1365759004}}-->Values not change any more


Senario 4)
# virsh dommemstat qqqqq
actual 1048576
rss 246112
Comment 40 Jun Li 2013-12-30 03:52:34 EST
Verify this bug as followings:

Version-Release number of selected component (if applicable):
3.10.0-64.el7.x86_64
qemu-kvm-1.5.3-30.el7.x86_64

==========
*** win8.1-32 guest.
Note:inside guest should execute "blnsrv -i".
Steps:
1.Boot guest with balloon device
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 

2.Tried command 
{"name": "qom-list-types"},{"name": "qom-get"}, {"name": "qom-set"}, {"name": "qom-list"}

------
Senario 1)
{ "execute": "qom-list", 
             "arguments": { "path": "/machine/peripheral/balloon0" } }

--->output data 

{ "execute": "qom-list-types"}--->output data
--
Senario 2)
*Enables polling in the specified interval (value >0)

{ "execute": "qom-set",
             "arguments": { "path": "/machine/peripheral/balloon0",
                         "property": "guest-stats-polling-interval", "value": 2 } }
--
{ "execute": "qom-get",
  "arguments": { "path": "/machine/peripheral/balloon0",
  "property": "guest-stats" } }
{"return": {"stats": {"stat-swap-out": 0, "stat-free-memory": 2147483647, "stat-minor-faults": 3, "stat-major-faults": 0, "stat-total-memory": 2147483647, "stat-swap-in": 0}, "last-update": 1388392710}}
-----
Senario 3)
*Disables polling,Previous polled statistics are still valid and can be queried.(Value =0)

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

{ "execute": "qom-get",
  "arguments": { "path": "/machine/peripheral/balloon0",
  "property": "guest-stats" } }
{"return": {"stats": {"stat-swap-out": 0, "stat-free-memory": 2147483647, "stat-minor-faults": 0, "stat-major-faults": 0, "stat-total-memory": 2147483647, "stat-swap-in": 0}, "last-update": 1388392746}}

{ "execute": "qom-get",
  "arguments": { "path": "/machine/peripheral/balloon0",
  "property": "guest-stats" } }
{"return": {"stats": {"stat-swap-out": 0, "stat-free-memory": 2147483647, "stat-minor-faults": 0, "stat-major-faults": 0, "stat-total-memory": 2147483647, "stat-swap-in": 0}, "last-update": 1388392746}}
===========
*** Rhel7.0 guest:
Steps:
1.Boot guest with balloon device
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 

2.Tried command 
{"name": "qom-list-types"},{"name": "qom-get"}, {"name": "qom-set"}, {"name": "qom-list"}

------
Senario 1)
{ "execute": "qom-list", 
             "arguments": { "path": "/machine/peripheral/balloon0" } }

--->output data 

{ "execute": "qom-list-types"}--->output data
--
Senario 2)
*Enables polling in the specified interval (value >0)

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

{ "execute": "qom-get",
  "arguments": { "path": "/machine/peripheral/balloon0",
  "property": "guest-stats" } }
{"return": {"stats": {"stat-swap-out": 0, "stat-free-memory": 3470868480, "stat-minor-faults": 1082554, "stat-major-faults": 1389, "stat-total-memory": 4010504192, "stat-swap-in": 0}, "last-update": 1388393334}}
-----
Senario 3)
*Disables polling,Previous polled statistics are still valid and can be queried.(Value =0)

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

{ "execute": "qom-get",
  "arguments": { "path": "/machine/peripheral/balloon0",
  "property": "guest-stats" } }
{"return": {"stats": {"stat-swap-out": 0, "stat-free-memory": 3465347072, "stat-minor-faults": 1093097, "stat-major-faults": 1418, "stat-total-memory": 4010504192, "stat-swap-in": 0}, "last-update": 1388393358}}
--
{ "execute": "qom-get",
  "arguments": { "path": "/machine/peripheral/balloon0",
  "property": "guest-stats" } }
{"return": {"stats": {"stat-swap-out": 0, "stat-free-memory": 3465347072, "stat-minor-faults": 1093097, "stat-major-faults": 1418, "stat-total-memory": 4010504192, "stat-swap-in": 0}, "last-update": 1388393358}}
================
Based on above test, this bug has been veryfied.
Comment 41 juzhang 2013-12-30 03:58:56 EST
According to comment39 and comment40, set this issue as verified.
Comment 43 Ludek Smid 2014-06-13 07:49:44 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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