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 1741825 - [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 8
Classification: Red Hat
Component: libvirt
Version: 8.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.1
Assignee: Pavel Hrdina
QA Contact: yisun
URL:
Whiteboard:
Depends On: 1734353
Blocks: 1689297
TreeView+ depends on / blocked
 
Reported: 2019-08-16 07:49 UTC by yisun
Modified: 2020-11-06 03:40 UTC (History)
7 users (show)

Fixed In Version: libvirt-4.5.0-33.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1734353
Environment:
Last Closed: 2019-11-05 20:51:11 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:3345 0 None None None 2019-11-05 20:51:39 UTC

Description yisun 2019-08-16 07:49:41 UTC
+++ This bug was initially created as a clone of Bug #1734353 +++

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.

--- Additional comment from  on 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 1 yisun 2019-08-16 07:51:01 UTC
reproduced on: libvirt-4.5.0-31.module+el8.1.0+3808+3325c1a3.x86_64
so clone to rhel8.1 branch

Comment 8 yisun 2019-08-30 10:15:04 UTC
Verified on libvirt-4.5.0-33.module+el8.1.0+4066+0f1aadab.x86_64 and PASSED

1. Set --device-read-iops-sec 
 [root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh blkiotune avocado-vt-vm1 --device-read-iops-sec /dev/sda,123

[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh dumpxml avocado-vt-vm1 | grep 123
      <read_iops_sec>123</read_iops_sec>

[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# cat io.max
8:0 rbps=max wbps=max riops=123 wiops=max

2. Set --device-read-iops-sec 
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh blkiotune avocado-vt-vm1 --device-read-bytes-sec /dev/sda,5678

[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh dumpxml avocado-vt-vm1 | grep 5678
      <read_bytes_sec>5678</read_bytes_sec>
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# cat io.max
8:0 rbps=5678 wbps=max riops=123 wiops=max

3. Set --device-write-bytes-sec 
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh blkiotune avocado-vt-vm1 --device-write-bytes-sec /dev/sda,8765

[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh dumpxml avocado-vt-vm1 | grep 8765
      <write_bytes_sec>8765</write_bytes_sec>
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# cat io.max
8:0 rbps=5678 wbps=8765 riops=123 wiops=max

4. Set --device-write-iops-sec
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh blkiotune avocado-vt-vm1 --device-write-iops-sec /dev/sda,4321

[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh dumpxml avocado-vt-vm1 | grep 4321
      <write_iops_sec>4321</write_iops_sec>
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh blkiotune avocado-vt-vm1
weight         : 100
device_weight  :
device_read_iops_sec: /dev/sda,123
device_write_iops_sec: /dev/sda,4321
device_read_bytes_sec: /dev/sda,5678
device_write_bytes_sec: /dev/sda,8765

[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# cat io.max
8:0 rbps=5678 wbps=8765 riops=123 wiops=4321

5. Set all to max
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh blkiotune avocado-vt-vm1 --device-read-iops-sec /dev/sda,0 --device-read-bytes-sec /dev/sda,0 --device-write-bytes-sec /dev/sda,0 --device-write-iops-sec /dev/sda,0

[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh blkiotune avocado-vt-vm1
weight         : 100
device_weight  :
device_read_iops_sec:
device_write_iops_sec:
device_read_bytes_sec:
device_write_bytes_sec:

6. Set all to 1111
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# cat io.max
8:0 rbps=1111 wbps=1111 riops=max wiops=1111
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh blkiotune avocado-vt-vm1 --device-read-iops-sec /dev/sda,0 --device-read-bytes-sec /dev/sda,0 --device-write-bytes-sec /dev/sda,0 --device-write-iops-sec /dev/sda,0

[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# cat io.max
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh blkiotune avocado-vt-vm1 --device-read-iops-sec /dev/sda,1111 --device-read-bytes-sec /dev/sda,1111 --device-write-bytes-sec /dev/sda,1111 --device-write-iops-sec /dev/sda,1111

[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# virsh dumpxml avocado-vt-vm1 | grep 1111
      <read_iops_sec>1111</read_iops_sec>
      <write_iops_sec>1111</write_iops_sec>
      <read_bytes_sec>1111</read_bytes_sec>
      <write_bytes_sec>1111</write_bytes_sec>
[root@hp-dl320eg8-07 machine-qemu\x2d2\x2davocado\x2dvt\x2dvm1.scope]# cat io.max
8:0 rbps=1111 wbps=1111 riops=1111 wiops=1111

Comment 10 errata-xmlrpc 2019-11-05 20:51:11 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/RHSA-2019:3345


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