Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 770830 - --config doesn't work correctly for blkiotune option --device-weight
--config doesn't work correctly for blkiotune option --device-weight
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
medium Severity high
: rc
: ---
Assigned To: Gunannan Ren
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-29 06:44 EST by weizhang
Modified: 2013-02-21 02:07 EST (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:07:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 16:18:26 EST

  None (edit)
Description weizhang 2011-12-29 06:44:58 EST
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 07:34:03 EST
patch sent to upstream
https://www.redhat.com/archives/libvir-list/2012-February/msg00104.html
Comment 3 Gunannan Ren 2012-02-10 01:55:19 EST
commit c8c239a439dca7600cd52066966c1c59a838e167
Author: Eric Blake <eblake@redhat.com>
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 06:46:31 EDT
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 07:13:40 EDT
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 06:13:38 EDT
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 02:07:06 EST
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.