RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1329041 - blkdeviotune should limit the maximum to some sensible number
Summary: blkdeviotune should limit the maximum to some sensible number
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-21 01:56 UTC by Pei Zhang
Modified: 2016-11-03 18:43 UTC (History)
8 users (show)

Fixed In Version: libvirt-1.3.4-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:43:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Pei Zhang 2016-04-21 01:56:23 UTC
Description of problem:
1. Make the boundary number is correct.
If I set value 9223372036854775807, I will get 9223372036854775808.If I set 9223372036854775808 I will get error.

2. If I change the corresponded *max value, then I cannot set other value any more, and will get "unexpected error"
2.1 Should we forbid set *max value
2.2 we should handle the error return from qemu rather than giving "unexpected error"

3. If the value is a comparatively large number, the value I set and in xml is different with what I get.
I am not sure for blkdeviotune value we also need to set into qemu, then get the value to fill in xml.
Like if I set 92233720368547758, the will get 92233720368547760.


Version-Release number of selected component (if applicable):
libvirt-1.3.3-2.el7.x86_64
qemu-kvm-rhev-2.5.0-4.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start a guest as following

# virsh domblklist r72
Target     Source
------------------------------------------------
vda        /tmp/zp/r72.qcow2
vde        /var/lib/libvirt/images/fd.img

1.1 If I set 9223372036854775807, I will get 9223372036854775808.

# virsh blkdeviotune r72 vde --total-bytes-sec 9223372036854775807

# virsh blkdeviotune r72 vde
total_bytes_sec: 9223372036854775808
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
......

1.2 If I set 9223372036854775808 I will get error.
# virsh blkdeviotune r72 vde --total-bytes-sec 9223372036854775808
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807


2. Perhaps we should forbid set *-max value.
If I set the cooresponded *max, like following I have total-bytes value, then I change total-bytes max.

# virsh blkdeviotune r72 vde --total-bytes-sec-max 20000000000000000

# virsh blkdeviotune r72 vde
total_bytes_sec: 9223372036854775808
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 20000000000000000
read_bytes_sec_max: 0

2.1 I could change total-bytes value

# virsh blkdeviotune r72 vde --total-bytes-sec 92233720368547758

# virsh blkdeviotune r72 vde
total_bytes_sec: 92233720368547760
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 20000000000000000
read_bytes_sec_max: 0

2.2 But I cannot change other value.

# virsh blkdeviotune r72 vde --read-bytes-sec 102400000
error: Unable to change block I/O throttle
error: internal error: Unexpected error

actual error : debug : qemuMonitorJSONIOProcessLine:189 : Line [{"id": "libvirt-52", "error": {"class": "GenericError", "desc": "bps_max/iops_max require corresponding bps/iops values"}}]
2016-04-20 09:42:53.898+0000: 28914: info : qemuMonitorJSONIOProcessLine:209 : QEMU_MONITOR_RECV_REPLY: mon=0x7fc69c0034b0 reply={"id": "libvirt-52", "error": {"class": "GenericError", "desc": "bps_max/iops_max require corresponding bps/iops values"}}


2.3 set the *max to 0, it will recover the correct max vlaue, and then I can set other value again.
# virsh blkdeviotune r72 vde --total-bytes-sec-max 0
# virsh blkdeviotune r72 vde
total_bytes_sec: 92233720368547760
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 9223372036854776
read_bytes_sec_max: 0


3. The value in domain xml is different from the value in command line .

Like if I set 92233720368547758, the will get 92233720368547760.

# virsh blkdeviotune r72 vde --read-bytes-sec 92233720368547758

# virsh blkdeviotune r72 vde
total_bytes_sec: 92233720368547760
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 9223372036854776
read_bytes_sec_max: 0

<disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/fd.img'/>
      <backingStore/>
      <target dev='vde' bus='virtio'/>
      <iotune>
        <read_bytes_sec>92233720368547758</read_bytes_sec>
      </iotune>
      <alias name='virtio-disk4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>

Actual results:
As step1, the maximum value is not correct.
As step2, cannot set value if change the max value
As step3, the value in domain xml and getting from command are different

Expected results:
Fix them.

Additional info:

Comment 1 Martin Kletzander 2016-04-22 06:36:07 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

Comment 2 Hao Liu 2016-04-23 08:49:43 UTC
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

Comment 3 Martin Kletzander 2016-04-25 09:58:37 UTC
(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

Comment 4 Martin Kletzander 2016-04-25 10:17:10 UTC
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

Comment 6 lijuan men 2016-05-06 09:27:55 UTC
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?

Comment 7 Gu Nini 2016-06-07 10:34:59 UTC
(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'.

Comment 8 Martin Kletzander 2016-06-07 11:06:15 UTC
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?

Comment 9 Gu Nini 2016-06-08 02:58:20 UTC
(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!

Comment 10 lijuan men 2016-06-12 09:14:48 UTC
(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

Comment 11 lijuan men 2016-08-24 06:20:37 UTC
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

Comment 12 Gu Nini 2016-08-24 08:38:44 UTC
(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'.

Comment 13 Gu Nini 2016-08-24 09:23:17 UTC
(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.

Comment 14 Martin Kletzander 2016-09-01 08:57:32 UTC
Yes, this is being dealt with in Bug 1344897 already.

Comment 15 lijuan men 2016-09-02 06:57:05 UTC
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.

Comment 16 Martin Kletzander 2016-09-20 08:02:35 UTC
(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.

Comment 17 lijuan men 2016-09-20 09:58:56 UTC
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>

Comment 18 lijuan men 2016-09-20 10:01:37 UTC
for comment15,the new bug 1377648 will track it

Comment 20 errata-xmlrpc 2016-11-03 18:43:22 UTC
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


Note You need to log in before you can comment on or make changes to this bug.