Bug 770830 - --config doesn't work correctly for blkiotune option --device-weight
Summary: --config doesn't work correctly for blkiotune option --device-weight
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Gunannan Ren
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-29 11:44 UTC by weizhang
Modified: 2013-02-21 07:07 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 07:07:06 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Description weizhang 2011-12-29 11:44:58 UTC
Description of problem:
When do
# virsh blkiotune test --device-weights /dev/sda,400 --config
for a running domain, it seems that it can not effect after reboot. 

When you check with 
# virsh blkiotune test
weight         : 900
device_weight  : /dev/sda,400

It seems that it effect the running domain, but in fact it does not
# cat /cgroup/blkio/libvirt/qemu/test/blkio.weight_device
nothing here

Reboot the guest and check, the device_weight does not set 
# virsh blkiotune test
weight         : 900
device_weight  : 

Version-Release number of selected component (if applicable):
kernel-2.6.32-223.el6.x86_64
libvirt-0.9.8-1.el6.x86_64
qemu-kvm-0.12.1.2-2.213.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Start a guest and check
# virsh blkiotune test 
weight         : 900
device_weight  : 

2. Set block device weight with --config
# virsh blkiotune test --device-weights /dev/sda,400 --config

3. check
# virsh blkiotune test 
weight         : 900
device_weight  : /dev/sda,400

4. check cgroup
# cat /cgroup/blkio/libvirt/qemu/test/blkio.weight_device
nothing return

5. reboot guest and check
# virsh blkiotune test 
weight         : 900
device_weight  : 

# cat /cgroup/blkio/libvirt/qemu/test/blkio.weight_device
nothing return
  
Actual results:
as above 

Expected results:
For step3, should not list device_weight
For step5, should change the device_weight

Additional info:

Comment 2 Gunannan Ren 2012-02-02 12:34:03 UTC
patch sent to upstream
https://www.redhat.com/archives/libvir-list/2012-February/msg00104.html

Comment 3 Gunannan Ren 2012-02-10 06:55:19 UTC
commit c8c239a439dca7600cd52066966c1c59a838e167
Author: Eric Blake <eblake>
Date:   Tue Feb 7 17:38:41 2012 -0700

    qemu: fix persistent setting of blkiodevice weights
    
    virsh blkiotune dom --device-weights /dev/sda,400 --config
    
    wasn't working correctly.
    
    * src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Use
    correct definition.

Comment 4 EricLee 2012-03-26 10:46:31 UTC
When I use versions of:
kernel-2.6.32-251.el6.x86_64
qemu-kvm-0.12.1.2-2.248.el6.x86_64
libvirt-0.9.10-6.el6.x86_64

#virsh blkiotune test --device-weights /dev/sda,400 --config
has no effect.

# virsh blkiotune qcow2_fo
weight         : 500
device_weight  : 

# virsh blkiotune qcow2_fo  --device-weights /dev/sda,400 --config

# virsh blkiotune qcow2_fo
weight         : 500
device_weight  :

Comment 5 EricLee 2012-03-26 11:13:40 UTC
Sorry, I got the wrong understanding.

1.# virsh blkiotune mig32
weight         : 500
device_weight  : 

2.# virsh blkiotune mig32 --device-weights /dev/sda,400 --config

3.# virsh blkiotune mig32
weight         : 500
device_weight  : 
4.# virsh destroy mig32
Domain mig32 destroyed

5.# virsh start mig32
Domain mig32 started

6.# virsh blkiotune mig32
weight         : 500
device_weight  : /dev/sda,400

7.# virsh blkiotune mig32 --device-weights /dev/sda,800 --config

8.# virsh blkiotune mig32
weight         : 500
device_weight  : /dev/sda,400

9.# virsh destroy mig32
Domain mig32 destroyed

10.# virsh start mig32
Domain mig32 started

11.# virsh blkiotune mig32
weight         : 500
device_weight  : /dev/sda,800

It's the expected result, So the bug has been fixed?

Comment 8 EricLee 2012-08-13 10:13:38 UTC
Verified this bug with libvirt-0.10.0-0rc0.el6.x86_64:

# virsh start qcow2
Domain qcow2 started

# virsh blkiotune qcow2
weight         : 500
device_weight  : 

# virsh blkiotune qcow2 --device-weights /dev/sda,400 --config

# virsh blkiotune qcow2
weight         : 500
device_weight  : 

As expected.

Reboot guest
# virsh destroy qcow2
Domain qcow2 destroyed

# virsh start qcow2
Domain qcow2 started

And recheck blkiotune:
# virsh blkiotune qcow2
weight         : 500
device_weight  : /dev/sda,400

As expected.

Also check weight_device in cgroup:
# cat /cgroup/blkio/libvirt/qemu/qcow2/blkio.weight_device
8:0	400

reconfig it:
# virsh blkiotune qcow2 --device-weights /dev/sda,600 --config

# cat /cgroup/blkio/libvirt/qemu/qcow2/blkio.weight_device
8:0	400
As expected.

# virsh blkiotune qcow2
weight         : 500
device_weight  : /dev/sda,400

Restart guest:
# virsh destroy qcow2
Domain qcow2 destroyed

# virsh start qcow2
Domain qcow2 started

Check blkiotune and weight_device in cgroup:
# virsh blkiotune qcow2
weight         : 500
device_weight  : /dev/sda,600

# cat /cgroup/blkio/libvirt/qemu/qcow2/blkio.weight_device
8:0	600
As expected.

So moving to VERIFIED.

Comment 9 errata-xmlrpc 2013-02-21 07:07:06 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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html


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