Bug 1122819

Summary: Cannot use blkdeviotune to set limit for a shut off guest
Product: Red Hat Enterprise Linux 6 Reporter: Luyao Huang <lhuang>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: dyuan, jmiao, jsuchane, lhuang, mkletzan, mzhan, rbalakri, tlavigne, zhwang, zpeng
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.2-43.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 04:23:18 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-07-24 07:25:43 UTC
Description of problem:
Cannot use blkdeviotune to set limit for a shut off guest

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-0.12.1.2-2.431.el6.x86_64
libvirt-0.10.2-41.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     test                           shut off
 -     test2                          shut off
 -     test3                          shut off

2.# virsh dumpxml test

 <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/test.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>

3.# virsh blkdeviotune test vda 10000
error: Unable to change block I/O throttle
error: unsupported configuration: block I/O throttling not supported with this QEMU binary




Actual results:
Cannot use blkdeviotune set limit for a shut off guest,and report a wrong error.
qemu-kvm-rhev have supported vda before. 

Expected results:
No error report

Additional info:
Also found this bug in RHEL6.5.z:
version:
libvirt-0.10.2-29.el6_5.11.x86_64
qemu-kvm-rhev-0.12.1.2-2.415.el6_5.12.x86_64

Comment 2 Ján Tomko 2014-07-24 08:11:54 UTC
Fixed upstream by:
commit 5af3ce827767707097affc5e001eab8cbabc28a7
Author:     Martin Kletzander <mkletzan>
CommitDate: 2013-05-24 13:29:20 +0200

    Fix blkdeviotune for shutoff domain
    
    Function qemuDomainSetBlockIoTune() was checking QEMU capabilities
    even when !(flags & VIR_DOMAIN_AFFECT_LIVE) and the domain was
    shutoff, resulting in the following problem:
    
     virsh # domstate asdf; blkdeviotune asdf vda --write-bytes-sec 100
     shut off
    
     error: Unable to change block I/O throttle
     error: unsupported configuration: block I/O throttling not supported with this QEMU binary
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=965016

git describe: v1.0.5-371-g5af3ce8 contains: v1.0.6-rc1~15

Comment 5 Luyao Huang 2014-08-11 06:21:45 UTC
I can't reproduce with libvirt-0.10.2-43.el6.x86_64 in root mode.
Steps:

1.# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     test6                          shut off

2. # virsh blkdeviotune test6 hda 24

3. # virsh blkdeviotune test6 hda
total_bytes_sec: 24
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 0

4.# virsh blkdeviotune test6 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

But i still found this bug in session mode:
1.$ virsh uri
qemu:///session

2.$ virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     sdfs                           shut off

3.$ virsh blkdeviotune sdfs 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

4.$ virsh blkdeviotune sdfs hda 1
error: Unable to change block I/O throttle
error: unsupported configuration: block I/O throttling not supported with this QEMU binary

Comment 6 Martin Kletzander 2014-08-11 08:35:16 UTC
But that's a whole different issue.  Commit 45ad1adb would nee to be backported for that, but it would *only* change the error message, it still wouldn't be available.

Comment 7 Luyao Huang 2014-08-11 09:32:45 UTC
(In reply to Martin Kletzander from comment #6)
> But that's a whole different issue.  Commit 45ad1adb would nee to be
> backported for that, but it would *only* change the error message, it still
> wouldn't be available.

I am sorry i don't know why it would only change the error message. From our doc in mojo blkdeviotune can be used in session mode.So i think it can be used to a shut off geust insession mode.

Thanks,
Luyao Huang

Comment 8 Martin Kletzander 2014-08-13 10:03:32 UTC
(In reply to Luyao Huang from comment #7)
Well, that was probably a bug, because we set the limiting using cgroups (as well), and that can't be done without root privileges.

Comment 14 Martin Kletzander 2014-08-15 12:34:55 UTC
Oh, I apologize for the confusion, I've mistaken blkiotune with blkdeviotune again. Of course this can be fixed in this BZ as well, it's a trivial patch. Than you for your patience.

Comment 15 dyuan 2014-08-19 06:46:49 UTC
(In reply to Martin Kletzander from comment #14)
> Oh, I apologize for the confusion, I've mistaken blkiotune with blkdeviotune
> again. Of course this can be fixed in this BZ as well, it's a trivial patch.
> Than you for your patience.

Hi Martin, will you re-assign this bug and post a fix to it again ?

Comment 16 Martin Kletzander 2014-08-19 07:25:22 UTC
I'm re-assigning it back to myself as this is waiting for one more (trivial) patch to go in.

Comment 17 Martin Kletzander 2014-08-19 13:08:43 UTC
As I see it, it works in session mode on, so there was no point in putting this back in ASSIGNED.  The fix was needed upsteam, but not in libvirt-0.10.2-43.  Here is the output I tested.  So I'm putting this back to ON_QA, please verify it ASAP and in case there is any other problem with session mode or anything else, file a new bug for it.

[test@rhel66 ~]$ rpm -q libvirt
libvirt-0.10.2-43.el6.x86_64
[test@rhel66 ~]$ virsh uri
qemu:///session

[test@rhel66 ~]$ virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     asdf                           shut off

[test@rhel66 ~]$ virsh blkdeviotune asdf 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

[test@rhel66 ~]$ virsh blkdeviotune asdf vda 10

[test@rhel66 ~]$ virsh blkdeviotune asdf vda
total_bytes_sec: 10
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 0

[test@rhel66 ~]$ virsh blkdeviotune asdf vda 0

[test@rhel66 ~]$ virsh blkdeviotune asdf 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

Comment 18 Luyao Huang 2014-08-20 01:56:28 UTC
(In reply to Martin Kletzander from comment #17)
> As I see it, it works in session mode on, so there was no point in putting
> this back in ASSIGNED.  The fix was needed upsteam, but not in
> libvirt-0.10.2-43.  Here is the output I tested.  So I'm putting this back
> to ON_QA, please verify it ASAP and in case there is any other problem with
> session mode or anything else, file a new bug for it.
> 
> [test@rhel66 ~]$ rpm -q libvirt
> libvirt-0.10.2-43.el6.x86_64
> [test@rhel66 ~]$ virsh uri
> qemu:///session
> 
> [test@rhel66 ~]$ virsh list --all
>  Id    Name                           State
> ----------------------------------------------------
>  -     asdf                           shut off
> 
> [test@rhel66 ~]$ virsh blkdeviotune asdf 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
> 
> [test@rhel66 ~]$ virsh blkdeviotune asdf vda 10
> 
> [test@rhel66 ~]$ virsh blkdeviotune asdf vda
> total_bytes_sec: 10
> read_bytes_sec : 0
> write_bytes_sec: 0
> total_iops_sec : 0
> read_iops_sec  : 0
> write_iops_sec : 0
> 
> [test@rhel66 ~]$ virsh blkdeviotune asdf vda 0
> 
> [test@rhel66 ~]$ virsh blkdeviotune asdf 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

Hi martin ,i have did it again and found issue disappear.Maybe the last time my
env was wrong.So set this bug status to verified.

But i have a problem about blkdeviotune can't be used in session mode in RHEL7.As you say in Comment 10 , i think blkdeviotune should can be used in session mode in RHEL7.Can i open a new Bug about this issue?

Comment 19 Martin Kletzander 2014-08-20 04:07:49 UTC
Yes, please create a new bug for that and assign it to me, thank you.

Comment 20 Luyao Huang 2014-08-20 05:31:11 UTC
(In reply to Martin Kletzander from comment #19)
> Yes, please create a new bug for that and assign it to me, thank you.

OK,i filed a new bug 1131788 for this issue.

Comment 22 errata-xmlrpc 2014-10-14 04:23:18 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.

http://rhn.redhat.com/errata/RHBA-2014-1374.html