Red Hat Bugzilla – Bug 770830
--config doesn't work correctly for blkiotune option --device-weight
Last modified: 2013-02-21 02:07:06 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:
patch sent to upstream https://www.redhat.com/archives/libvir-list/2012-February/msg00104.html
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.
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 :
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?
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.
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