Bug 1131306
Summary: | number range should be checked for the 4 new options of blkiotune | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
Component: | libvirt | Assignee: | Martin Kletzander <mkletzan> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.2 | CC: | dyuan, jiahu, lhuang, mkletzan, mzhan, pzhang, rbalakri |
Target Milestone: | rc | Keywords: | Upstream |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.8-6.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-03-05 07:42:39 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Luyao Huang
2014-08-19 01:23:46 UTC
Fix proposed upstream: https://www.redhat.com/archives/libvir-list/2014-August/msg00795.html Fixed upstream by v1.2.7-182-ge80adb0 and v1.2.7-183-g970ac2a: commit 970ac2a0fe19eb6088fb4cd8b982014ee9b143dc Author: Martin Kletzander <mkletzan> Date: Tue Aug 19 14:54:30 2014 +0200 qemu: forbid negative blkio values commit e80adb0ed51c8533d7fbcaf8438a9de1e4fa51af Author: Martin Kletzander <mkletzan> Date: Tue Aug 19 14:54:24 2014 +0200 lxc: forbid negative blkio values Verify this issue with build libvirt-1.2.8-1.el7.x86_64: Steps to verify: 1.# virsh list --all Id Name State ---------------------------------------------------- 5 test3 running 2.# virsh blkiotune test3 weight : 500 device_weight : device_read_iops_sec: /dev/sda,12 device_write_iops_sec: device_read_bytes_sec: device_write_bytes_sec: 3.# virsh blkiotune test3 --device-read-iops-sec /dev/sda,12 4.# virsh blkiotune test3 weight : 500 device_weight : device_read_iops_sec: /dev/sda,12 device_write_iops_sec: device_read_bytes_sec: device_write_bytes_sec: 5. # cat /sys/fs/cgroup/blkio/machine.slice/machine-qemu\\x2dtest3.scope/blkio.throttle.read_iops_device 8:0 12 6. # virsh blkiotune test3 --device-read-iops-sec /dev/sda,-2 error: Unable to change blkio parameters error: invalid argument: unable to parse blkio device 'device_read_iops_sec' '/dev/sda,-2' 7.# virsh blkiotune test3 weight : 500 device_weight : device_read_iops_sec: /dev/sda,12 device_write_iops_sec: device_read_bytes_sec: device_write_bytes_sec: 8. # cat /sys/fs/cgroup/blkio/machine.slice/machine-qemu\\x2dtest3.scope/blkio.throttle.read_iops_device 8:0 12 9. # virsh blkiotune test3 --device-read-bytes-sec /dev/sda,-2 error: Unable to change blkio parameters error: invalid argument: unable to parse blkio device 'device_read_bytes_sec' '/dev/sda,-2' 10.# virsh blkiotune test3 weight : 500 device_weight : device_read_iops_sec: /dev/sda,12 device_write_iops_sec: device_read_bytes_sec: device_write_bytes_sec: 11. #cat /sys/fs/cgroup/blkio/machine.slice/machine-qemu\\x2dtest3.scope/blkio.throttle.read_bps_device 12. # virsh blkiotune test3 --device-read-bytes-sec /dev/sda,-1 error: Unable to change blkio parameters error: invalid argument: unable to parse blkio device 'device_read_bytes_sec' '/dev/sda,-1' 13. # virsh blkiotune test3 weight : 500 device_weight : device_read_iops_sec: /dev/sda,12 device_write_iops_sec: device_read_bytes_sec: device_write_bytes_sec: 14. #virsh blkiotune test3 --device-read-bytes-sec /dev/sda,0 15. # virsh blkiotune test3 weight : 500 device_weight : device_read_iops_sec: /dev/sda,12 device_write_iops_sec: device_read_bytes_sec: device_write_bytes_sec: 16. # cat /sys/fs/cgroup/blkio/machine.slice/machine-qemu\\x2dtest3.scope/blkio.throttle.read_bps_device Could reproduce this issue with build libvirt-1.2.7-1.el7.x86_64 as bug description mentioned. varify version : libvirt-1.2.8-5.el7.x86_64 qemu-kvm-rhev-2.1.2-4.el7.x86_64 kernel-3.10.0-191.el7.x86_64 steps: 1. set a negative value [root@184 images]# virsh blkiotune r7 --device-read-bytes-sec /dev/sda,-1 error: Unable to change blkio parameters error: invalid argument: unable to parse blkio device 'device_read_bytes_sec' '/dev/sda,-1' 2. set a non-numeric value [root@184 images]# virsh blkiotune r7 --device-read-bytes-sec /dev/sda,aa error: Unable to change blkio parameters error: invalid argument: unable to parse blkio device 'device_read_bytes_sec' '/dev/sda,aa' 3. try to set iops to max value 3.1) set value=4294967294 , set successfully. and can be checked in cgroup. [root@184 images]# virsh blkiotune r7 --device-read-iops-sec /dev/sda,4294967294 [root@184 images]# cat /sys/fs/cgroup/blkio/machine.slice/machine-qemu\\x2dr7.scope/blkio.throttle.read_iops_device 8:0 4294967294 3.2) set value=4294967295 , set successfully. but can not be checked in cgroup. [root@184 images]# virsh blkiotune r7 --device-read-iops-sec /dev/sda,4294967295 [root@184 images]# cat /sys/fs/cgroup/blkio/machine.slice/machine-qemu\\x2dr7.scope/blkio.throttle.read_iops_device [root@184 images]# 3.3) set value=4294967296 , set failed. [root@184 images]# virsh blkiotune r7 --device-read-iops-sec /dev/sda,4294967296 error: Unable to change blkio parameters error: invalid argument: unable to parse blkio device 'device_read_iops_sec' '/dev/sda,4294967296' 4. try to set bytes to max value. 4.1) set value=18446744073709551614 , set successfully. and can be checked in cgroup [root@184 images]# cat /sys/fs/cgroup/blkio/machine.slice/machine-qemu\\x2dr7.scope/blkio.throttle.read_bps_device 8:0 18446744073709551614 4.2) set value=18446744073709551615 , set successfully. but can not be checked in cgroup [root@184 images]# virsh blkiotune r7 --device-read-bytes-sec /dev/sda,18446744073709551615 [root@184 images]# cat /sys/fs/cgroup/blkio/machine.slice/machine-qemu\\x2dr7.scope/blkio.throttle.read_bps_device 4.3) set value=18446744073709551616 ,set failed. [root@184 images]# virsh blkiotune r7 --device-read-bytes-sec /dev/sda,18446744073709551616 error: Unable to change blkio parameters error: invalid argument: unable to parse blkio device 'device_read_bytes_sec' '/dev/sda,18446744073709551616' 5. dumpxml to check value. it has the value in the domain XML. [root@184 images]# virsh dumpxml r7 | grep blkiotune -A8 <blkiotune> <device> <path>/dev/sda</path> <weight>100</weight> <read_iops_sec>4294967295</read_iops_sec> <read_bytes_sec>18446744073709551615</read_bytes_sec> </device> </blkiotune> Note: in the step 3.2 and 4.2 , the value can be set successfully and checked using blkiotune and also in doamin XML , but actually it can not be set in cgroup . Is it right? and if it's better to give error message as a range , like : parameter xxx valid value from 0 to xxx. We can't use an error message with the range as the range might differ based on kernel/qemu/etc. Anyway, negative values could yield better error. I'll post a fix soon. Fixed upstream with v1.2.10-6-g278bf0a and v1.2.10-7-gb3880bb: commit 278bf0acbfe9d468dceafde580ecce97ba9cc4e5 Author: Martin Kletzander <mkletzan> AuthorDate: Wed Oct 29 16:36:39 2014 +0100 qemu: improve error message for invalid blkiotune settings commit b3880bbe97bd0881d7860cff25c1409e74f2e9ab Author: Martin Kletzander <mkletzan> AuthorDate: Wed Oct 29 16:36:39 2014 +0100 lxc: improve error message for invalid blkiotune settings Of course if there is a value set behind libvirt's back, you won't be able to check it in the XML. To properly work with the limits, we might read those values back after writing them to make sure we output the right value (for example if UINT_MAX means the same as 0 for the kernel), just to make sure we cope exactly, however, that is something completely unrelated to this bug and might be done later on, but not now as it's very low priority. varify version : kernel-3.10.0-203.el7.x86_64 qemu-kvm-rhev-2.1.2-8.el7.x86_64 libvirt-1.2.8-6.el7.x86_64 steps: 1.prepare a running guest # virsh list Id Name State ---------------------------------------------------- 27 r7 running 2.check blkiotune # virsh blkiotune r7 weight : 500 device_weight : device_read_iops_sec: device_write_iops_sec: device_read_bytes_sec: device_write_bytes_sec: 3. set negative value # virsh blkiotune r7 --device-write-iops-sec /dev/sda,-1 error: Unable to change blkio parameters error: invalid argument: invalid value '-1' for parameter 'device_write_iops_sec' of device '/dev/sda' # virsh blkiotune r7 --device-read-iops-sec /dev/sda,-1 error: Unable to change blkio parameters error: invalid argument: invalid value '-1' for parameter 'device_read_iops_sec' of device '/dev/sda' # virsh blkiotune r7-dir --device-read-iops-sec /dev/sda,0 # virsh blkiotune r7 --device-read-bytes-sec /dev/sda,aaa error: Unable to change blkio parameters error: invalid argument: invalid value 'aaa' for parameter 'device_read_bytes_sec' of device '/dev/sda' # virsh blkiotune r7 --device-write-iops-sec /dev/sda,10,/dev/sdb,-1 error: Unable to change blkio parameters error: invalid argument: invalid value '-1' for parameter 'device_write_iops_sec' of device '/dev/sdb' # virsh blkiotune r7 --device-write-bytes-sec /dev/sda,1000 # virsh blkiotune r7 weight : 500 device_weight : device_read_iops_sec: device_write_iops_sec: device_read_bytes_sec: device_write_bytes_sec: /dev/sda,1000 can't set negative value any more , move this bug to verified. and thanks for Martin's help , according to comment 7 and comment 12 . open a new bug 1165580 on 7.2 to trace the question about properly working with the limits . 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 |