Bug 1329041
Summary: | blkdeviotune should limit the maximum to some sensible number | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Pei Zhang <pzhang> |
Component: | libvirt | Assignee: | Martin Kletzander <mkletzan> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.3 | CC: | dyuan, hliu, lmen, mkletzan, mzhan, ngu, rbalakri, xuzhang |
Target Milestone: | rc | Keywords: | Upstream |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.3.4-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-11-03 18:43:22 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
Pei Zhang
2016-04-21 01:56:23 UTC
Fixed upstream with v1.3.3-295-g2d04f6de77d4: commit 2d04f6de77d437fa60361950e5f18fac8c1c922d Author: Martin Kletzander <mkletzan> Date: Wed Apr 20 16:14:02 2016 +0200 qemu: Limit maximum block device I/O tune values Hi, Martin, After testing with your patch, it seems that the error message does not match with the boundary value. It should be "no more than" according to the result or the boundary value should be decremented by 1. Please help check it out. Thanks. # virsh blkdeviotune avocado-vt-vm1 --current --device vda --write-bytes-sec 1000000000000000 # virsh blkdeviotune avocado-vt-vm1 --current --device vda --write-bytes-sec 1000000000000001 error: Unable to change block I/O throttle error: argument unsupported: block I/O throttle limit value must be less than 1000000000000000 (In reply to Hao Liu from comment #2) You're right, sorry for that. I sent a patch for it here: https://www.redhat.com/archives/libvir-list/2016-April/msg01639.html Error message fixed by v1.3.3-306-g72c313bce904: commit 72c313bce9043a181cc951871f38a37f6cbeb785 Author: Martin Kletzander <mkletzan> Date: Mon Apr 25 11:54:56 2016 +0200 qemu: Fix off-by-one error in block I/O throttle messages I have two scenarios I don't understand,could someone help explain them? Thanks in advance. scenario 1: When the values of total_bytes_sec and total_bytes_sec_max are both 0,total_bytes_sec_max can't be set as other values.Is it reasonable? 1.set total_bytes_sec and total_bytes_sec_max as 0. [root@localhost ~]# virsh blkdeviotune r7 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 total_bytes_sec_max: 0 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 2.set total_bytes_sec_max as other value [root@localhost ~]# virsh blkdeviotune r7 vda --total_bytes_sec_max 123 error: Unable to change block I/O throttle error: internal error: Unexpected error Is the result reasonable? If reasonable,could you output some specific error information? "Unexpected error"is not specific. scenario 2:If I change the corresponded *max value, then I cannot set other value any more 1.set total_bytes_sec and total_bytes_sec_max as 123 and 456. [root@localhost ~]# virsh blkdeviotune r7 vda --total_bytes_sec 123 [root@localhost ~]# virsh blkdeviotune r7 vda --total_bytes_sec_max 456 [root@localhost ~]# virsh blkdeviotune r7 vda total_bytes_sec: 123 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 456 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 2.set read_bytes_sec as 789 [root@localhost ~]# virsh blkdeviotune r7 vda --read_bytes_sec 789 --->set failed error: Unable to change block I/O throttle error: internal error: Unexpected error 3.set total_bytes_sec as 0 and 789 [root@localhost ~]# virsh blkdeviotune r7 vda --total_bytes_sec 0 ---> set failed error: Unable to change block I/O throttle error: internal error: Unexpected error [root@localhost ~]# virsh blkdeviotune r7 vda --total_bytes_sec 789 --->set successfully [root@localhost ~]# virsh blkdeviotune r7 vda total_bytes_sec: 789 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 456 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 Can read_bytes_sec and total_bytes_sec be set as other values? (In reply to lijuan men from comment #6) > I have two scenarios I don't understand,could someone help explain them? > Thanks in advance. > > scenario 1: > When the values of total_bytes_sec and total_bytes_sec_max are both > 0,total_bytes_sec_max can't be set as other values.Is it reasonable? > 'total_bytes_sec_max' could not be set before setting 'total_bytes_sec', it's just as design in qemu side, and it's also suitable for the iops and read/write parameters; however, libvrit should give detailed error prompt such as 'The max value could not be set before setting the corresponding bps/iops value'. > > scenario 2:If I change the corresponded *max value, then I cannot set other > value any more > The max value could not coexist with corresponding read/wrete values, it's also as design in qemu side. And libvirt should give detailed error prompt such as 'bps/iops/max total values and the read/write values cannot be used at the same time'. Funny you are replying now when I just started investigating that. Yes, qemu itself at that error says "bps_max/iops_max require corresponding bps/iops values" and libvirt should check for that. However I believe it's a different issue than this BZ was created for. Could you please file a new one and assign it to me? (In reply to Martin Kletzander from comment #8) > Funny you are replying now when I just started investigating that. Yes, > qemu itself at that error says "bps_max/iops_max require corresponding > bps/iops values" and libvirt should check for that. However I believe it's > a different issue than this BZ was created for. Could you please file a new > one and assign it to me? Lijuan, Could you help to create the bug and assign to Martin Kletzander? Thanks! (In reply to Gu Nini from comment #9) > (In reply to Martin Kletzander from comment #8) > > Funny you are replying now when I just started investigating that. Yes, > > qemu itself at that error says "bps_max/iops_max require corresponding > > bps/iops values" and libvirt should check for that. However I believe it's > > a different issue than this BZ was created for. Could you please file a new > > one and assign it to me? > > Lijuan, > > Could you help to create the bug and assign to Martin Kletzander? > > Thanks! ok,I have created a bug https://bugzilla.redhat.com/show_bug.cgi?id=1344897 There are also two confusing scenarios secnario1: 1).set total_bytes_sec as 777,set total_bytes_sec_max as 555(value is less than total_bytes_sec),max value can't be set 2).set total_bytes_sec as 777,set total_bytes_sec_max as 888(value is more than total_bytes_sec),max value can be set successfully Is this expected? secnario2: 1).set total_bytes_sec as 1000,set total_bytes_sec_max as 2000,then set read-bytes-sec(or write-bytes-sec),the error info is : value 'total_bytes_sec_max' cannot be set if 'total_bytes_sec' is not set is the error info accurate? the detailed test steps for the two scenarios are as followed: secnario1: [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 777 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 77 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@localhost ~]# virsh blkdeviotune bios hda --total_bytes_sec_max 66 error: Unable to change block I/O throttle error: internal error: Unexpected error [root@localhost ~]# virsh blkdeviotune bios hda --total_bytes_sec_max 888 [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 777 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 888 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 scenario2: # virsh blkdeviotune vm2 vda --total-bytes-sec 1000 [root@184pzhang rng]# virsh blkdeviotune vm2 vda total_bytes_sec: 1000 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 100 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@184pzhang rng]# virsh blkdeviotune vm2 vda --total-bytes-sec-max 2000 [root@184pzhang rng]# virsh blkdeviotune vm2 vda total_bytes_sec: 1000 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 2000 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@184pzhang rng]# virsh blkdeviotune vm2 vda --read-bytes-sec 3000 error: Unable to change block I/O throttle error: unsupported configuration: value 'total_bytes_sec_max' cannot be set if 'total_bytes_sec' is not set [root@184pzhang rng]# virsh blkdeviotune vm2 vda --write-bytes-sec 3000 error: Unable to change block I/O throttle error: unsupported configuration: value 'total_bytes_sec_max' cannot be set if 'total_bytes_sec' is not set (In reply to lijuan men from comment #11) > There are also two confusing scenarios > > secnario1: > 1).set total_bytes_sec as 777,set total_bytes_sec_max as 555(value is less > than total_bytes_sec),max value can't be set > 2).set total_bytes_sec as 777,set total_bytes_sec_max as 888(value is more > than total_bytes_sec),max value can be set successfully > > Is this expected? Yes, after the fix of bz1355665, it's expected behavior since the max value should be equal or bigger than the throttle value. > > secnario2: > 1).set total_bytes_sec as 1000,set total_bytes_sec_max as 2000,then set > read-bytes-sec(or write-bytes-sec),the error info is : > value 'total_bytes_sec_max' cannot be set if 'total_bytes_sec' is not set > > is the error info accurate? > Surely it's not correct. It should be something like 'bps/iops/max total values and the read/write values cannot be used at the same time'. (In reply to Gu Nini from comment #12) > (In reply to lijuan men from comment #11) ...... > > > > > secnario2: > > 1).set total_bytes_sec as 1000,set total_bytes_sec_max as 2000,then set > > read-bytes-sec(or write-bytes-sec),the error info is : > > value 'total_bytes_sec_max' cannot be set if 'total_bytes_sec' is not set > > > > is the error info accurate? > > > > Surely it's not correct. It should be something like 'bps/iops/max total > values and the read/write values cannot be used at the same time'. Sorry, it's my fault, above prompt should be used when set the bps/iops/max total values and the corresponding read/write values together INSTEAD of setting the them one by one. And both qemu/libvirt don't allow to set the parameters one by one. And the same applies to the reply in comment #7. So I think the logic in libvirt must has some issue. Yes, this is being dealt with in Bug 1344897 already. I have arranged the logic for blkdeviotune. It needs to be confirmed with you. logic1:the value of total_bytes_sec and total_bytes_sec_max can't be set **one by one**,so the scenario1 below is right,and scenario 2 below is wrong. scenario 1: [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 0 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@localhost ~]# virsh blkdeviotune bios hda --total-bytes-sec-max 10 error: Unable to change block I/O throttle error: unsupported configuration: value 'total_bytes_sec_max' cannot be set if 'total_bytes_sec' is not set scenario2: [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 0 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@localhost ~]# virsh blkdeviotune bios hda --total-bytes-sec 1000 [root@localhost ~]# virsh blkdeviotune bios hda --total-bytes-sec-max 2000 (-->more than total-bytes-sec) [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 1000 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 2000 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 logic2: the value of total_bytes_sec and total_bytes_sec_max can be set ***at the same time***, but the value of total_bytes_sec_max can't be less than total_bytes_sec. so the scenario1 below is right,and the error info of scenario 2 below is not accurate. scenario 3: [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 0 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@localhost ~]# virsh blkdeviotune bios hda --total-bytes-sec 1000 --total-bytes-sec-max 2000 -->(the value of total-bytes-sec-max is more than total-bytes-sec) [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 1000 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 2000 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 scenario4: [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 0 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@localhost ~]# virsh blkdeviotune bios hda --total-bytes-sec 1000 --total-bytes-sec-max 500 -->(the value of total-bytes-sec-max is ***less*** than total-bytes-sec) error: Unable to change block I/O throttle error: internal error: Unexpected error logic3: for the following parameter,total and read/write cannot be set at the same time.but read and write can be set at the same time parameter: total_bytes_sec read_bytes_sec write_bytes_sec logic4: for the following parameter,they can be set one by one. but after setting one parameter ,the value of other parameters will be set as 0 automatically. the secnario 5 below is right,but secnario 6 blow is wrong. parameter: total_bytes_sec read_bytes_sec write_bytes_sec total_iops_sec read_iops_sec write_iops_sec scenario5: [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 0 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@localhost ~]# virsh blkdeviotune bios hda --read-bytes-sec 100 [root@localhost ~]# virsh blkdeviotune bios hda --write-bytes-sec 200 [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 0 read_bytes_sec : 0 -->it is set as 0 automatically. write_bytes_sec: 200 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 0 read_bytes_sec_max: 0 write_bytes_sec_max: 20 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 scenario 6: [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 0 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@localhost ~]# virsh blkdeviotune bios hda --total-bytes-sec 200 [root@localhost ~]# virsh blkdeviotune bios hda --total-iops-sec 300 [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 200 --->it should be set as 0 automatically. read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 300 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 20 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 30 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 Is there something wrong in the above logic? Pls feel free to point out my mistakes. thanks. (In reply to lijuan men from comment #15) Yes, there are some things that could be fixed, but the error messages or the null-ing behaviour doesn't look like it's cause by this bug being fixed. Please create a different bug for that or add the info to Bug 1344897 if it feels related. the scenario1 and scenario3 in bug description is verified,the scenario2 is being tracked in bug 1344897. so change the bug status as verified. The following is the test steps for scenario1 and scenario3. version: libvirt-2.0.0-9.el7.x86_64 qemu-kvm-rhev-2.6.0-25.el7.x86_64 scenario1: [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 0 read_bytes_sec : 0 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 0 read_bytes_sec_max: 0 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@localhost ~]# virsh blkdeviotune bios hda --total-bytes-sec 9223372036854775808 error: Unable to change block I/O throttle error: argument unsupported: block I/O throttle limit value must be no more than 1000000000000000 scenario3: [root@localhost ~]# virsh blkdeviotune bios hda --read-bytes-sec 1000000000000000 [root@localhost ~]# virsh blkdeviotune bios hda total_bytes_sec: 0 read_bytes_sec : 1000000000000000 write_bytes_sec: 0 total_iops_sec : 0 read_iops_sec : 0 write_iops_sec : 0 total_bytes_sec_max: 0 read_bytes_sec_max: 100000000000000 write_bytes_sec_max: 0 total_iops_sec_max: 0 read_iops_sec_max: 0 write_iops_sec_max: 0 size_iops_sec : 0 [root@localhost ~]# virsh dumpxml bios | grep disk -A 12 <suspend-to-disk enabled='no'/> </pm> <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/rhel7.2.qcow2'/> <backingStore/> <target dev='hda' bus='ide'/> <iotune> <read_bytes_sec>1000000000000000</read_bytes_sec> </iotune> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> for comment15,the new bug 1377648 will track it 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-2016-2577.html |