Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
libguiestfs tools are not working as they have in RHEL 7.x with the change of qemu-img now using the -U to varify a live image.
When using tools like virt-df and the rest of the virt-* tools against a live VM, it is unable to access the backing file because of write lock
Version-Release number of selected component (if applicable):
libguestfs-1.38.4-14
qemu-kvm-2.12.0-88
kernel-4.18.0-147.el8.x86_64
How reproducible:
100 %
Steps to Reproduce:
1. yum install '*guestf*'
2. start a KVM guest
3. virt-df -d <domain_name>
Actual results:
~~~
# virt-df -d rhel-7
libguestfs: error: could not create appliance through libvirt.
Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct
Original error from libvirt: internal error: process exited while connecting to monitor: arserial0,id=serial0 -chardev socket,id=charchannel0,path=/tmp/libguestfsMAjZPC/guestfsd.sock -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.libguestfs.channel.0 -object rng-random,id=objrng0,filename=/dev/urandom -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x4 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
2020-03-03 17:29:46.520+0000: Domain id=3 is tainted: custom-argv
2020-03-03 17:29:46.520+0000: Domain id=3 is tainted: host-cpu
2020-03-03T17:29:46.590130Z qemu-kvm: -drive file=/tmp/libguestfsCUcrvw/overlay1.qcow2,format=qcow2,if=none,id=drive-scsi0-0-0-0,cache=unsafe: Could not open backing file: Failed to get shared "write" lock
Is another process using the image [/home/qemu/rhel-server-7.7-x86_64-kvm.qcow2]? [code=1 int1=-1]
~~~
Expected results:
When runnig the same in RHEL 7
~~~
[root@localhost ~]# virt-df -d rhel7.7
Filesystem 1K-blocks Used Available Use%
rhel7.7:/dev/sda1 8181760 1738520 6443240 22%
~~~
Additional info:
The following commit is supposed to be included it
https://github.com/libguestfs/libguestfs/commit/f00f920ad3b15ab8e9e8f201c16e7628b6b7b109
Actually, this is slightly different than what was originally suggested.
While it is true that virt:rhel lacks that patch, it won't fix the issue, as it is a much bigger problem -- see bug 1519242 for the reason why the libvirt backend (used by default in RHEL) fails in the described scenario.
Because of this, fixing this will require fixing bug 1519242, which is definitely not a piece of cake.
As a workaround, the 'direct' libguestfs backend can be used -- for example:
$ LIBGUESTFS_BACKEND=direct virt-df -d rhel-7
Comment 12Richard W.M. Jones
2022-01-24 16:16:42 UTC
This bug cannot be fixed without fixing libvirt. There is
a workaround in comment 6 which can be used instead. If the
workaround isn't adequate then you'll need to work with the
libvirt team to address bug 1519242.