Bug 1100769

Summary: blkiotune weight range should be (10, 1000)
Product: Red Hat Enterprise Linux 7 Reporter: zhe peng <zpeng>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: dyuan, lhuang, mkletzan, mzhan, rbalakri, shyu, xuzhang
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.2.7-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 07:36:15 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 zhe peng 2014-05-23 12:16:03 UTC
Description of problem:
blkiotune weight range should be (10,1000) after kernel 2.6.39


Version-Release number of selected component (if applicable):
libvirt-1.1.1-29.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1.prepare a guest
2.# virsh blkiotune base --weight 99
error: Unable to change blkio parameters
error: invalid argument: out of blkio weight range.


Actual results:


Expected results:
After kernel 2.6.39, the value could be in the range [10, 1000].

Additional info:

Comment 2 Martin Kletzander 2014-07-24 17:22:32 UTC
Fixed upstream with v1.2.6-257-g9318121:

commit 9318121db83f8c8151d88bf7de72774decc2b544
Author: Martin Kletzander <mkletzan>
Date:   Thu Jul 24 13:43:47 2014 +0200

    remove range checking for blkiotune weight

Comment 4 Shanzhi Yu 2014-11-26 07:28:11 UTC
I am trying verify this bug.

0. Prepare a running guest
# virsh list 
 Id    Name                           State
----------------------------------------------------
 4     rh7                            running

# virsh blkiotune rh7
weight         : 1000
device_weight  : 
device_read_iops_sec: 
device_write_iops_sec: 
device_read_bytes_sec: 
device_write_bytes_sec: 

1. with value smaller than 10

1.1 Set with invalid value
# virsh blkiotune rh7 --weight 9
error: Unable to change blkio parameters
error: Invalid value '9' for 'blkio.weight': Invalid argument

1.2 Check the value, make sure it doesn't change 

# virsh blkiotune rh7
weight         : 1000
device_weight  : 
device_read_iops_sec: 
device_write_iops_sec: 
device_read_bytes_sec: 
device_write_bytes_sec: 

2. with value large than 100

2.1 Set with invalid value
# virsh blkiotune rh7 --weight 1001
error: Unable to change blkio parameters
error: Invalid value '1001' for 'blkio.weight': Invalid argument

2.2 Check the value, make sure it doesn't change 
# virsh blkiotune rh7
weight         : 1000
device_weight  : 
device_read_iops_sec: 
device_write_iops_sec: 
device_read_bytes_sec: 
device_write_bytes_sec: 

3. Set value with 10 or 1000, it work as expected

# virsh blkiotune rh7 --weight 10

# virsh blkiotune rh7
weight         : 10
device_weight  : 
device_read_iops_sec: 
device_write_iops_sec: 
device_read_bytes_sec: 
device_write_bytes_sec: 

# virsh blkiotune rh7 --weight 1000

# virsh blkiotune rh7
weight         : 1000
device_weight  : 
device_read_iops_sec: 
device_write_iops_sec: 
device_read_bytes_sec: 
device_write_bytes_sec:

Hi Martin,
I have one problem about trying set blkiotune when guest is shut off status, it will not post error when try to set a invalid value. I am not sure if libvirt should post error in such case.

# virsh list  --inactive 
 Id    Name                           State
----------------------------------------------------
 -     rh7                            shut off

# virsh blkiotune rh7 --weight 1

# virsh start rh7
error: Failed to start domain rh7
error: Invalid value '1' for 'blkio.weight': Invalid argument

If you think it is ok, I will verify this bug.

Thanks

Comment 5 Martin Kletzander 2014-11-26 08:24:07 UTC
Since we removed the checks for the range, you can set what kernel allows (if the domain is running) and anything if it is not.  However, kernel has to allow it when it is starting.  So it works exactly as it should.

Comment 6 Shanzhi Yu 2014-11-26 08:29:54 UTC
Change to verify according comment 4 and comment 5

Comment 8 errata-xmlrpc 2015-03-05 07:36:15 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-2015-0323.html