Bug 1157997

Summary: FOO_max for I/O throttling official support on rhel 7.1
Product: Red Hat Enterprise Linux 7 Reporter: Jun Li <juli>
Component: libvirtAssignee: John Ferlan <jferlan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 7.1CC: dyuan, eblake, ederevea, famz, hhuang, jdenemar, juzhang, lmiksik, michen, ngu, pzhang, qzhang, rbalakri, virt-bugs, virt-maint, xfu, xuzhang
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.2.13-1.el7 Doc Type: Enhancement
Doc Text:
Feature: Add support for more Block Device I/O Throttling options. In particular a series of "maximum" values to complement the existing set of "average" values. Reason: The existing values limit an average number of operations allowed which can cause certain limitations during "bursts" of activities. The "maximum" values provide an upper limit to handle bursts of activity to complete reasonably, while still placing an "average" limit of activity. Result: New options were added to the virsh blkdeviotune command: --total-bytes-sec-max specifies maximum total throughput limit in bytes per second. --read-bytes-sec-max specifies maximum read throughput limit in bytes per second. --write-bytes-sec-max specifies maximum write throughput limit in bytes per second. --total-iops-sec-max specifies maximum total I/O operations limit per second. --read-iops-sec-max specifies maximum read I/O operations limit per second. --write-iops-sec-max specifies maximum write I/O operations limit per second. --size-iops-sec specifies size I/O operations limit per second.
Story Points: ---
Clone Of: 1146755 Environment:
Last Closed: 2015-11-19 05:54:30 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:
Bug Depends On: 1146755, 1247830    
Bug Blocks:    

Comment 5 Gu Nini 2015-03-12 07:29:12 UTC
The bug also occurred under power KVM, the detailed software versions are as follows:

Host kernel: 3.10.0-229.el7.ppc64
Qemu KVM: qemu-kvm-rhev-2.2.0-5.el7.ppc64
Libvirt: libvirt-1.2.8-16.el7.ppc64

That's the virsh cmd 'virsh blkdeviotune' couldn't set each FOO_max options.

Comment 6 Gu Nini 2015-03-12 07:37:43 UTC
Change the 'Hardware' field to 'All' since it exists on both x86_64 and ppc64.

Comment 7 John Ferlan 2015-05-13 13:07:24 UTC
Support for these variables have been added to libvirt 1.2.11 which will be included in the RHEL7.2 release.  Moving bug to MODIFIED.

Once RHEL7.2 is released and if there is a z-stream bug approved, then someone will need to backport git commit id's 'c040e14b' through '72f808c4'.  Then at least follow up commit id's 'a01eea30', '5c08b125', and '00af23810'.  Not sure if there are more, but those were quickly referenced.

Comment 8 Jiri Denemark 2015-05-13 13:28:16 UTC
This is not something we want or even should backport to a z-stream, though.

Comment 11 Xuesong Zhang 2015-09-25 06:41:40 UTC
Verify with the following packages, this bug is verified.
libvirt-1.2.17-10.el7.x86_64
qemu-kvm-rhev-2.3.0-22.el7.x86_64
kernel-3.10.0-319.el7.x86_64

Split to 2 scenarios since total_bytes_sec/iops_max cannot appear with read_bytes/iops_sec_max or write_bytes/iops_sec_max.

Scenario1: setting parameters read_bytes_sec_max, write_bytes_sec_max, read_iops_sec_max and read_iops_sec_max
1. prepare one guest like following:
......
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/rhel7.1-virtio.img'/>
      <backingStore/>
      <target dev='sda' bus='scsi'/>
      <iotune>
        <read_bytes_sec>10000000</read_bytes_sec>
        <write_bytes_sec>20000000</write_bytes_sec>
        <read_iops_sec>300000</read_iops_sec>
        <write_iops_sec>400000</write_iops_sec>
        <read_bytes_sec_max>50000000</read_bytes_sec_max>
        <write_bytes_sec_max>60000000</write_bytes_sec_max>
        <read_iops_sec_max>700000</read_iops_sec_max>
        <write_iops_sec_max>800000</write_iops_sec_max>
      </iotune>
      <alias name='scsi0-0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
......

2. start guest and check the disk iotune via command blkdeviotune.
# virsh start rhel71
Domain rhel71 started
# virsh blkdeviotune rhel71 sda
total_bytes_sec: 0
read_bytes_sec : 10000000
write_bytes_sec: 20000000
total_iops_sec : 0
read_iops_sec  : 300000
write_iops_sec : 400000
total_bytes_sec_max: 0
read_bytes_sec_max: 50000000
write_bytes_sec_max: 60000000
total_iops_sec_max: 0
read_iops_sec_max: 700000
write_iops_sec_max: 800000
size_iops_sec  : 0

3. the qemu command line is as expected.
-drive file=/var/lib/libvirt/images/rhel7.1-virtio.img,if=none,id=drive-scsi0-0-0-0,format=qcow2,bps_rd=10000000,bps_wr=20000000,iops_rd=300000,iops_wr=400000,bps_rd_max=50000000,bps_wr_max=60000000,iops_rd_max=700000,iops_wr_max=800000

4. set the *_max parameter's value to 0.
# virsh blkdeviotune rhel71 sda --read-bytes-sec-max=0  --write-bytes-sec-max=0 --read-iops-sec-max=0 --write-iops-sec-max=0

5. then the *_max parameter's value turned to be the corresponding parameter's 1/10, it's as expected.
# virsh blkdeviotune rhel71 sda
total_bytes_sec: 0
read_bytes_sec : 10000000
write_bytes_sec: 20000000
total_iops_sec : 0
read_iops_sec  : 300000
write_iops_sec : 400000
total_bytes_sec_max: 0
read_bytes_sec_max: 1000000
write_bytes_sec_max: 2000000
total_iops_sec_max: 0
read_iops_sec_max: 30000
write_iops_sec_max: 40000
size_iops_sec  : 0

6. set the *_max parameter's value to some other value.
# virsh blkdeviotune rhel71 sda --read-bytes-sec-max=12345678  --write-bytes-sec-max=23456789 --read-iops-sec-max=345678 --write-iops-sec-max=456789

7. checking with blkdeviotune command, the value is as exptected.
# virsh blkdeviotune rhel71 sda
total_bytes_sec: 0
read_bytes_sec : 10000000
write_bytes_sec: 20000000
total_iops_sec : 0
read_iops_sec  : 300000
write_iops_sec : 400000
total_bytes_sec_max: 0
read_bytes_sec_max: 12345678
write_bytes_sec_max: 23456789
total_iops_sec_max: 0
read_iops_sec_max: 345678
write_iops_sec_max: 456789
size_iops_sec  : 0


Scenario2: setting parameter total_bytes_sec_max and total_iops_sec_max
1. prepare one guest like following:
......
   <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/rhel7.1-virtio.img'/>
      <backingStore/>
      <target dev='sda' bus='scsi'/>
      <iotune>
        <total_bytes_sec>10000000</total_bytes_sec>
        <total_iops_sec>300000</total_iops_sec>
        <total_bytes_sec_max>50000000</total_bytes_sec_max>
        <total_iops_sec_max>700000</total_iops_sec_max>
      </iotune>
      <alias name='scsi0-0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
......

2. start guest and check the disk iotune via command blkdeviotune.
# virsh start rhel71
Domain rhel71 started
# virsh blkdeviotune rhel71 sda
total_bytes_sec: 10000000
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 300000
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 50000000
read_bytes_sec_max: 0
write_bytes_sec_max: 0
total_iops_sec_max: 700000
read_iops_sec_max: 0
write_iops_sec_max: 0
size_iops_sec  : 0

3. the qemu command line is as expected.
-drive file=/var/lib/libvirt/images/rhel7.1-virtio.img,if=none,id=drive-scsi0-0-0-0,format=qcow2,bps=10000000,iops=300000,bps_max=50000000,iops_max=700000

4. set the *_max parameter's value to 0.
# virsh blkdeviotune rhel71 sda --total-bytes-sec-max=0 --total-iops-sec-max=0

5. then the *_max parameter's value turned to be the corresponding parameter's 1/10, it's as expected.
# virsh blkdeviotune rhel71 sda
total_bytes_sec: 10000000
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 300000
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 1000000
read_bytes_sec_max: 0
write_bytes_sec_max: 0
total_iops_sec_max: 30000
read_iops_sec_max: 0
write_iops_sec_max: 0
size_iops_sec  : 0

6. set the *_max parameter's value to some other value.
# virsh blkdeviotune rhel71 sda --total-bytes-sec-max=12345678 --total-iops-sec-max=4567789

7. checking with blkdeviotune command, the value is as exptected.
# virsh blkdeviotune rhel71 sda
total_bytes_sec: 10000000
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 300000
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 12345678
read_bytes_sec_max: 0
write_bytes_sec_max: 0
total_iops_sec_max: 4567789
read_iops_sec_max: 0
write_iops_sec_max: 0
size_iops_sec  : 0

Comment 13 errata-xmlrpc 2015-11-19 05:54:30 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/RHBA-2015-2202.html