Bug 1733163
| Summary: | Hot-plug disks cannot detect blkdeviotune information when -blockdev enabled | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | gaojianan <jgao> | ||||||
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Meina Li <meili> | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | 8.1 | CC: | hhan, jdenemar, jgao, knoel, lmen, meili, pkrempa, xuzhang, yisun | ||||||
| Target Milestone: | rc | Flags: | knoel:
mirror+
|
||||||
| Target Release: | --- | ||||||||
| Hardware: | x86_64 | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | libvirt-5.9.0-1.el8 | Doc Type: | If docs needed, set a value | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2020-05-05 09:46:33 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: | |||||||||
| Attachments: |
|
||||||||
Does it not work both for -blockdev enabled or disabled? (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. I'll investigate it as it appears to be blockdev related. 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
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
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
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
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 |
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.