Bug 1733163 - Hot-plug disks cannot detect blkdeviotune information when -blockdev enabled
Summary: Hot-plug disks cannot detect blkdeviotune information when -blockdev enabled
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Meina Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-25 09:52 UTC by gaojianan
Modified: 2020-05-05 09:46 UTC (History)
9 users (show)

Fixed In Version: libvirt-5.9.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 09:46:33 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log from start to check (16.00 KB, text/plain)
2019-07-25 09:52 UTC, gaojianan
no flags Details
domain and device xml (1.53 KB, application/gzip)
2020-01-19 03:05 UTC, Han Han
no flags Details

Description gaojianan 2019-07-25 09:52:43 UTC
Created attachment 1593352 [details]
log from start to check

Description of problem:
Hot-plug disks cannot detect blkdeviotune information

Version-Release number of selected component (if applicable):
libvirt-5.5.0-1.module+el8.1.0+3580+d7f6488d.x86_64
qemu-kvm-4.0.0-5.module+el8.1.0+3622+5812d9bf.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a guest "rhel8-block-test" and a disk.xml with <iotune>
<disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source dev='/dev/sdb'/>
      <target dev='vdb' bus='virtio'/>
         <iotune>
        <total_bytes_sec>5000</total_bytes_sec>
        <total_iops_sec>6000</total_iops_sec>
        <total_bytes_sec_max>10000</total_bytes_sec_max>
        <total_iops_sec_max>11000</total_iops_sec_max>
        <group_name>libvirt_iotune_group1</group_name>
      </iotune>
    </disk>

2.Attach the disk to the vm
# virsh attach-device rhel8-block-test disk2.xml
Deviced attached successfully

3.Check the blkdeviotune status
# virsh blkdeviotune rhel8-block-test vdb   
total_bytes_sec: 0
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 0
read_bytes_sec_max: 0
write_bytes_sec_max: 0
total_iops_sec_max: 0
read_iops_sec_max: 0
write_iops_sec_max: 0
size_iops_sec  : 0
group_name     :
total_bytes_sec_max_length: 0
read_bytes_sec_max_length: 0
write_bytes_sec_max_length: 0
total_iops_sec_max_length: 0
read_iops_sec_max_length: 0
write_iops_sec_max_length: 0

It should like :
...
total_bytes_sec: 5000
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 6000
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 10000
read_bytes_sec_max: 0
write_bytes_sec_max: 0
total_iops_sec_max: 11000
read_iops_sec_max: 0
write_iops_sec_max: 0
size_iops_sec  : 0
group_name     : libvirt_iotune_group1
total_bytes_sec_max_length: 1
...

Actual results:
As step 3,all options are 0

Expected results:
It should have correct numbers as what we set in disk.xml

Additional info:
If you cold-plug the disk to guest and start it,there'll be no error.

More log in attachment.

Comment 1 Han Han 2019-07-30 05:49:58 UTC
Does it not work both for -blockdev enabled or disabled?

Comment 2 gaojianan 2019-07-30 06:14:18 UTC
(In reply to Han Han from comment #1)
> Does it not work both for -blockdev enabled or disabled?

It works well(can show the blk info) when -blcokdev disabled.

Comment 3 Peter Krempa 2019-09-04 14:23:44 UTC
I'll investigate it as it appears to be blockdev related.

Comment 4 Peter Krempa 2019-09-06 06:20:12 UTC
Fixed upstream:

commit 3fbaf0587c0448d6adfdd7d1dd0e6a748ec060ee
Author: Peter Krempa <pkrempa>
Date:   Thu Sep 5 15:09:50 2019 +0200

    qemu: hotplug: Setup disk throttling with blockdev
    
    With blockdev we must issue the block_set_io_throttle QMP command to
    setup disk throttling as we currently can't do it with the 'throttle'
    layer.
    
    Unfortunately there's nothing we can do if it fails.

v5.7.0-12-g3fbaf0587c

Comment 6 Han Han 2020-01-19 03:05:01 UTC
Created attachment 1653518 [details]
domain and device xml

It works on libvirt-6.0.0-1.module+el8.2.0+5453+31b2b136.x86_64 qemu-kvm-4.2.0-6.module+el8.2.0+5453+31b2b136.x86_64(no copy_on_read):
1. Start vm
2. Prepare a disk xml with block iotune:
# cat throttle.xml 
<disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback' io='threads'/>
      <source dev='/dev/sdb'/>
      <target dev='vdb' bus='virtio'/>
         <iotune>
        <total_bytes_sec>5000</total_bytes_sec>
        <total_iops_sec>6000</total_iops_sec>
        <total_bytes_sec_max>10000</total_bytes_sec_max>
        <total_iops_sec_max>11000</total_iops_sec_max>
        <group_name>libvirt_i</group_name>
      </iotune>
      <alias name='ua-new'/>
    </disk>

3. Attach and detach
# virsh attach-device pc /tmp/throttle.xml
Device attached successfully

# virsh detach-disk pc vdb                
Disk detached successfully

Comment 7 Meina Li 2020-03-09 08:14:15 UTC
Verified Version:
qemu-kvm-4.2.0-12.module+el8.2.0+5858+afd073bc.x86_64
libvirt-6.0.0-7.virtcov.el8.x86_64

Verified Steps:
1. Start vm
# virsh domstate lmn1 
running
2. Prepare a disk xml with block iotune:
# cat disk.xml 
<disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback' io='threads' copy_on_read='on'/>
      <source dev='/dev/sdn'/>
      <target dev='vdb' bus='virtio'/>
         <iotune>
        <total_bytes_sec>5000</total_bytes_sec>
        <total_iops_sec>6000</total_iops_sec>
        <total_bytes_sec_max>10000</total_bytes_sec_max>
        <total_iops_sec_max>11000</total_iops_sec_max>
        <group_name>libvirt_i</group_name>
      </iotune>
      <alias name='ua-new'/>
    </disk>
3. Attach the disk to the guest.
# virsh attach-device lmn1 disk.xml 
Device attached successfully
# virsh domblklist lmn1 
 Target   Source
---------------------------------------------
 vda      /var/lib/libvirt/images/lmn.qcow2
 vdb      /dev/sdn
4. Check the iotune of the disk.
# virsh blkdeviotune lmn1 vdb
total_bytes_sec: 5000
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 6000
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 10000
read_bytes_sec_max: 0
write_bytes_sec_max: 0
total_iops_sec_max: 11000
read_iops_sec_max: 0
write_iops_sec_max: 0
size_iops_sec  : 0
group_name     : libvirt_i
total_bytes_sec_max_length: 1
...
4. Detach the disk from the guest.
# virsh detach-device lmn1 disk.xml
Device detached successfully
# virsh domblklist lmn1 
 Target   Source
---------------------------------------------
 vda      /var/lib/libvirt/images/lmn.qcow2

Comment 8 Meina Li 2020-03-09 08:14:15 UTC
Verified Version:
qemu-kvm-4.2.0-12.module+el8.2.0+5858+afd073bc.x86_64
libvirt-6.0.0-7.virtcov.el8.x86_64

Verified Steps:
1. Start vm
# virsh domstate lmn1 
running
2. Prepare a disk xml with block iotune:
# cat disk.xml 
<disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback' io='threads' copy_on_read='on'/>
      <source dev='/dev/sdn'/>
      <target dev='vdb' bus='virtio'/>
         <iotune>
        <total_bytes_sec>5000</total_bytes_sec>
        <total_iops_sec>6000</total_iops_sec>
        <total_bytes_sec_max>10000</total_bytes_sec_max>
        <total_iops_sec_max>11000</total_iops_sec_max>
        <group_name>libvirt_i</group_name>
      </iotune>
      <alias name='ua-new'/>
    </disk>
3. Attach the disk to the guest.
# virsh attach-device lmn1 disk.xml 
Device attached successfully
# virsh domblklist lmn1 
 Target   Source
---------------------------------------------
 vda      /var/lib/libvirt/images/lmn.qcow2
 vdb      /dev/sdn
4. Check the iotune of the disk.
# virsh blkdeviotune lmn1 vdb
total_bytes_sec: 5000
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 6000
read_iops_sec  : 0
write_iops_sec : 0
total_bytes_sec_max: 10000
read_bytes_sec_max: 0
write_bytes_sec_max: 0
total_iops_sec_max: 11000
read_iops_sec_max: 0
write_iops_sec_max: 0
size_iops_sec  : 0
group_name     : libvirt_i
total_bytes_sec_max_length: 1
...
4. Detach the disk from the guest.
# virsh detach-device lmn1 disk.xml
Device detached successfully
# virsh domblklist lmn1 
 Target   Source
---------------------------------------------
 vda      /var/lib/libvirt/images/lmn.qcow2

Comment 10 errata-xmlrpc 2020-05-05 09:46:33 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-2020:2017


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