Red Hat Bugzilla – Bug 1131788
blkdeviotune should can be used in session mode
Last modified: 2015-03-05 02:42:44 EST
Description of problem: blkdeviotune should can be used in session mode Version-Release number of selected component (if applicable): libvirt-1.2.7-1.el7.x86_64 How reproducible: 100% Steps to Reproduce: $ virsh uri qemu:///session $ virsh blkdeviotune sdsd hda 1 error: Unable to change block I/O throttle error: unsupported configuration: Block I/O tuning is not available in session mode Actual results: blkdeviotune can't be used in session mode in RHEL7 Expected results: blkdeviotune can be used in session mode Additional info:
Fixed upstream with v1.2.7-157-g7d9def2: commit 7d9def2ec1afaf50ec680f2aadfe359cb1ba5b80 Author: Martin Kletzander <mkletzan@redhat.com> Date: Fri Aug 15 14:35:53 2014 +0200 qemu: allow device block I/O tuning in session mode
Although there is an bug https://bugzilla.redhat.com/show_bug.cgi?id=927369 to block to verify this issue, from the bug 927369, there is a workround by creating directory "$HOME/.cache/libvirt" Verify this issue with this workaround and build libvirt-1.2.8-2.el7.x86_64: [test@rhel7-a1 ~]$ virsh blkdeviotune rhel6 hda 2 [test@rhel7-a1 ~]$ virsh blkdeviotune rhel6 hda total_bytes_sec: 2 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 [test@rhel7-a1 ~]$ virsh blkdeviotune rhel6 hda 3 [test@rhel7-a1 ~]$ virsh blkdeviotune rhel6 hda total_bytes_sec: 3 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0
Verify vision: kernel-3.10.0-188.el7.x86_64 qemu-kvm-rhev-2.1.2-3.el7.x86_64 libvirt-1.2.8-5.el7.x86_64 steps: 1. add a user and switch to user mode. [test@184 images]$ virsh uri qemu:///session 2. using blkdeviotune query a block device I/O tuning parameters [test@184 images]$ virsh blkdeviotune rhel7 vda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 3. using blkdeviotune set a block device I/O tuning parameters [test@184 images]$ virsh blkdeviotune rhel7 vda 5 [test@184 images]$ virsh blkdeviotune rhel7 vda total_bytes_sec: 5 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 4. set --total-bytes-sec [test@184 images]$ virsh blkdeviotune r7new hda --total-bytes-sec 100 [test@184 images]$ virsh blkdeviotune r7new hda total_bytes_sec: 100 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 100 set --read-bytes-sec [test@184 images]$ virsh blkdeviotune r7new hda --read-bytes-sec 200 [test@184 images]$ virsh blkdeviotune r7new hda total_bytes_sec: 0 read_bytes_sec : 200 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 set --write-bytes-sec [test@184 images]$ virsh blkdeviotune r7new hda --write-bytes-sec 300 [test@184 images]$ virsh blkdeviotune r7new hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 300 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 set --total-iops-sec [test@184 images]$ virsh blkdeviotune r7new hda --total-iops-sec 400 [test@184 images]$ virsh blkdeviotune r7new hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 300 total_iops_sec : 400 read_iops_sec : 0 write_iops_sec : 0 set --read-iops-sec [test@184 images]$ virsh blkdeviotune r7new hda --read-iops-sec 500 [test@184 images]$ virsh blkdeviotune r7new hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 300 total_iops_sec : 0 read_iops_sec : 500 write_iops_sec : 0 set --write-iops-sec [test@184 images]$ virsh blkdeviotune r7new hda --write-iops-sec 600 [test@184 images]$ virsh blkdeviotune r7new hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 300 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 600 5. using blkdeviotune set a block device I/O tuning parameters with options --config [test@184 images]$ virsh blkdeviotune rhel7 vda 3 --config [test@184 images]$ virsh blkdeviotune rhel7 vda total_bytes_sec: 5 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 [test@184 images]$ virsh destroy rhel7 ; virsh start rhel7 Domain rhel7 destroyed Domain rhel7 started [test@184 images]$ virsh blkdeviotune rhel7 vda total_bytes_sec: 3 ------- reboot guest , this parameter was set. read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 --live [test@184 images]$ virsh blkdeviotune r7new hda --write-iops-sec 500 --live [test@184 images]$ virsh blkdeviotune r7new hda total_bytes_sec: 100 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 500 --current (domain is running) [test@184 images]$ virsh blkdeviotune r7new hda --read-bytes-sec 900 --current [test@184 images]$ virsh blkdeviotune r7new hda total_bytes_sec: 0 read_bytes_sec : 900 ----900 was set write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 500 --current (domain is shut off) [test@184 images]$ virsh blkdeviotune r7new hda --write-bytes-sec 400 --current [test@184 images]$ virsh start r7new Domain r7new started [test@184 images]$ virsh blkdeviotune r7new hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 400 ----400 was set total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 100 6. check setting only one value resets the other two in that category to unlimited. [test@184 images]$ virsh blkdeviotune rhel7 vda --read-bytes-sec 10 --write-bytes-sec 20 [test@184 images]$ virsh blkdeviotune rhel7 vda total_bytes_sec: 0 ----- total was reset to 0 read_bytes_sec : 10 -----read was set write_bytes_sec: 20 -----write was set total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 7. check Bytes and iops values are independent [test@184 images]$ virsh blkdeviotune rhel7 vda --read-bytes-sec 10 --write-iops-sec 10 [test@184 images]$ virsh blkdeviotune rhel7 vda total_bytes_sec: 0 read_bytes_sec : 10 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 10 8. negative testing --check total_bytes_sec cannot appear with read_bytes_sec or write_bytes_sec. [test@184 images]$ virsh blkdeviotune rhel7 vda --config --live --read-bytes-sec 10 --total-bytes-sec 1 error: Unable to change block I/O throttle error: invalid argument: total and read/write of bytes_sec cannot be set at the same time --check check total_iops_sec cannot appear with read_iops_sec or write_iops_sec. [test@184 images]$ virsh blkdeviotune rhel7 vda --live --read-bytes-sec 10 --write-bytes-sec 30 --total-iops-sec 1 --read-iops-sec 10 error: Unable to change block I/O throttle error: invalid argument: total and read/write of iops_sec cannot be set at the same time
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/RHSA-2015-0323.html