Bug 1734353 - [cgroup_v2] Error happened and xml not changed when use blkiotune to set blk cgroup values
Summary: [cgroup_v2] Error happened and xml not changed when use blkiotune to set blk ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: ---
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Pavel Hrdina
QA Contact: yisun
URL:
Whiteboard:
Depends On:
Blocks: 1513930 1741825
TreeView+ depends on / blocked
 
Reported: 2019-07-30 10:33 UTC by yisun
Modified: 2020-11-06 03:57 UTC (History)
2 users (show)

Fixed In Version: libvirt-5.6.0-3.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1741825 (view as bug list)
Environment:
Last Closed: 2019-11-06 07:18:12 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3723 0 None None None 2019-11-06 07:18:45 UTC

Description yisun 2019-07-30 10:33:34 UTC
Description:
[cgroup_v2] Error happened and xml not changed when use blkiotune to set blk cgroup values

Versions:
libvirt-5.5.0-2.module+el8.1.0+3773+7dd501bf.x86_64

How reproducible:
100%

Steps:
0. Enable cgroup v2
1. Having block device /dev/sda on host:
[root@ibm-x3250m6-06 ~]# lsblk
NAME                           MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                              8:0    0 931.5G  0 disk
...

2. Use blkiotune to set "--device-read-iops-sec" to a running vm
[root@ibm-x3250m6-06 ~]# virsh blkiotune avocado-vt-vm1 --device-read-iops-sec /dev/sda,1234
error: Unable to change blkio parameters
error: internal error: Unable to parse 'rbps=max wbps=max riops=1234 wiops=max' as an integer
<==== error produced

[root@ibm-x3250m6-06 ~]# virsh dumpxml avocado-vt-vm1 | grep 1234  | wc -l
0
<==== xml not changed

[root@ibm-x3250m6-06 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2davocado\\x2dvt\\x2dvm1.scope/io.max 
8:0 rbps=max wbps=max riops=1234 wiops=max
<==== but corresponding cgroup controller value changed as expected

3. set "--device-read-bytes-sec", same as step 2
[root@ibm-x3250m6-06 ~]# virsh blkiotune avocado-vt-vm1 --device-read-bytes-sec /dev/sda,5678
error: Unable to change blkio parameters
error: internal error: Unable to parse 'rbps=5678 wbps=max riops=1234 wiops=4321' as an integer

[root@ibm-x3250m6-06 ~]# virsh dumpxml avocado-vt-vm1 | grep 5678 | wc -l
0

[root@ibm-x3250m6-06 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2davocado\\x2dvt\\x2dvm1.scope/io.max 
8:0 rbps=5678 wbps=max riops=1234 wiops=4321

4. set "--device-write-bytes-sec", same as step 2
[root@ibm-x3250m6-06 ~]# virsh blkiotune avocado-vt-vm1 --device-write-bytes-sec /dev/sda,8765
error: Unable to change blkio parameters
error: internal error: Unable to parse 'rbps=5678 wbps=8765 riops=1234 wiops=4321' as an integer

[root@ibm-x3250m6-06 ~]# virsh dumpxml avocado-vt-vm1 | grep 8765 | wc -l
0

[root@ibm-x3250m6-06 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2davocado\\x2dvt\\x2dvm1.scope/io.max 
8:0 rbps=5678 wbps=8765 riops=1234 wiops=4321


5. setting "--device-write-iops-sec" is OK
[root@ibm-x3250m6-06 ~]# virsh blkiotune avocado-vt-vm1 --device-write-iops-sec /dev/sda,4321
[root@ibm-x3250m6-06 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2davocado\\x2dvt\\x2dvm1.scope/io.max 
8:0 rbps=max wbps=max riops=1234 wiops=4321
[root@ibm-x3250m6-06 ~]# virsh dumpxml avocado-vt-vm1 | grep 4321 | wc -l
1


Expected result:
No error happened and xml should be changed correctly.

Comment 1 yisun 2019-08-01 06:56:58 UTC
When set 2 or more devices concurrently, the error will block the 2nd and rest settings, as follow:
$ lsblk  | egrep "sda |sdb "
sda             8:0    0 465.8G  0 disk 
sdb             8:16   0  1000M  0 disk 


$ pwd
/sys/fs/cgroup/machine.slice/machine-qemu\x2d9\x2davocado\x2dvt\x2dvm1.scope

$ virsh blkiotune avocado-vt-vm1 --device-read-iops-sec /dev/sda,321321,/dev/sdb,123123
error: Unable to change blkio parameters
error: internal error: Unable to parse 'rbps=max wbps=max riops=321321 wiops=max' as an integer

$ cat io.max 
8:0 rbps=max wbps=max riops=321321 wiops=max
<===== here, only the /dev/sda setting takes effect.

Comment 5 yisun 2019-09-17 12:01:04 UTC
PASSED in auto test job with libvirt-5.6.0-5.module+el8.1.0+4229+2e4e348c.x86_64:
https://libvirt-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/libvirt-RHEL-8.1-runtest-x86_64-function-guest_resource_control/10/testReport/
(the single failed case is a script issue, not related to this bz)

Comment 7 errata-xmlrpc 2019-11-06 07:18:12 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://access.redhat.com/errata/RHBA-2019:3723


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