-
Story
-
Resolution: Unresolved
-
Undefined
-
None
-
libvirt-10.10.0-6.el9
-
None
-
1
-
rhel-sst-virt-tools
-
ssg_virtualization
-
26
-
5
-
Dev ack
-
False
-
-
None
-
RHEL-9.6/10.0 remaining items
-
Pass
-
Manual
-
None
This is a clone of issue RHEL-76802 to use for version rhel-9.6
–
Original description:
Goal
When debugging storage related issues the reason for a I/O may contain important information leading to the root cause. QEMU itself reports the error reason but libvirt (and other management layers up the stack) don't have access to it. The error itself is thus deeply burried only in debug logs of libvirtd.
The goal of this issue is to improve the error propagation to upper layers so that the errors can be captured in more visible and easier to access logs.
Acceptance criteria
A list of verification conditions, successful functional tests, or expected outcomes in order to declare this story/task successfully completed.
- Allow users query reason for the I/O error
- Improve logging of I/O error reasons
- Improve notification of upper layers about I/O errors
The libvirt interface will consist of logging the I/O error reason in the VM log file as well as allowing clients to query it via the virDomainGetMessages() API. Any application listening to libvirt events will also receive a notification in the reason field of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON that a reason is available. Since the reason is not meant for machine consumption it needs to be queried extra.
Layered products above libvirt should register the VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON event and also allow query the reason messages and log them for the users.
Easy way to test I/O errors with libvirt is to create a device-mapper device that will cause errors when interacted with:
1) create a image and map it to a loopback device
dd if=/dev/zero of=/tmp/img bs=512 count=1048576
losetup /dev/loop0 /tmp/img
2) create a device mapper device
dmsetup create errdev0 << EOF 0 261144 linear /dev/loop0 0 261144 5 error 261149 787427 linear /dev/loop0 261139 EOF
3) Use the device in a VM:
<disk type='block' device='disk'> <driver name='qemu' type='raw'/> <source dev='/dev/mapper/errdev0'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </disk>
4) In the VM read from the device
5) observe errors:
# virsh event --loop --all event 'io-error' for domain 'cd': /dev/mapper/errdev0 (virtio-disk0) report due to hypervisor-message $ virsh dominfo cd Id: 2 Name: cd UUID: 8e70100a-64b4-4186-aff9-e055c3075cb0 OS Type: hvm State: running CPU(s): 1 CPU time: 3032.4s Max memory: 1024000 KiB Used memory: 1024000 KiB Persistent: yes Autostart: disable Managed save: no Security model: selinux Security DOI: 0 Security label: unconfined_u:unconfined_r:svirt_t:s0:c429,c749 (permissive) Messages: tainted: hypervisor feature autodetection override tainted: custom device configuration I/O error: disk='vda', index='1', path='/dev/mapper/errdev0', timestamp='2025-01-28 15:47:52.776+0000', message'Input/output error'
- clones
-
RHEL-76802 Improve debuggability of storage I/O errors for qemu VMs
-
- Release Pending
-
- links to
-
RHBA-2024:140248 libvirt bug fix and enhancement update