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.
Created attachment 1121017[details]
The log of step2
Description of problem:
As summary
Version-Release number of selected component (if applicable):
libvirt-0.10.2-56.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.487.el6.x86_64
libvirt-lock-sanlock-0.10.2-56.el6.x86_64
sanlock-2.8-2.el6_5.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Setup libvirt sanlock on a host:
On host A
# setsebool sanlock_use_nfs 1 && setsebool virt_use_nfs 1 && setsebool virt_use_sanlock 1
# cat /etc/libvirt/qemu-sanlock.conf
auto_disk_leases = 1
disk_lease_dir = "/var/lib/libvirt/sanlock"
host_id = 1
user = "sanlock"
group = "sanlock"
# cat /etc/libvirt/qemu.conf
lock_manager = "sanlock"
# cat /etc/sysconfig/sanlock
SANLOCKOPTS="-w 0"
# service wdmd restart; service sanlock restart; service libvirtd restart
2. Create a guest and do external snapshot
# cat guest.xml
<domain type='kvm' id='1'>
...
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/var/lib/libvirt/images/c2.qcow2'/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</disk>
...
</domain>
# virsh create guest.xml
Domain cc created from guest.xml
# virsh list
Id Name State
----------------------------------------------------
6 cc running
# virsh snapshot-create-as cc s1 --disk-only --diskspec vda,file=/tmp/cc.s1
error: Failed to acquire lock: File exists
Snapshot file created but the snapshot failed.
# ll /tmp/cc.s1
-rw-------. 1 qemu qemu 2.2M Feb 4 10:17 /tmp/cc.s1
# virsh snapshot-list cc
Name Creation Time State
------------------------------------------------------------
When I rm the file and create it again:
# rm /tmp/cc.s1;virsh snapshot-create-as cc s1 --disk-only --diskspec vda,file=/tmp/cc.s1;
error: Timed out during operation: cannot acquire state change lock
Actual results:
As step2
Expected results:
No errors and snapshot create success.
Additional info:
Created attachment 1121017 [details] The log of step2 Description of problem: As summary Version-Release number of selected component (if applicable): libvirt-0.10.2-56.el6.x86_64 qemu-kvm-rhev-0.12.1.2-2.487.el6.x86_64 libvirt-lock-sanlock-0.10.2-56.el6.x86_64 sanlock-2.8-2.el6_5.x86_64 How reproducible: 100% Steps to Reproduce: 1. Setup libvirt sanlock on a host: On host A # setsebool sanlock_use_nfs 1 && setsebool virt_use_nfs 1 && setsebool virt_use_sanlock 1 # cat /etc/libvirt/qemu-sanlock.conf auto_disk_leases = 1 disk_lease_dir = "/var/lib/libvirt/sanlock" host_id = 1 user = "sanlock" group = "sanlock" # cat /etc/libvirt/qemu.conf lock_manager = "sanlock" # cat /etc/sysconfig/sanlock SANLOCKOPTS="-w 0" # service wdmd restart; service sanlock restart; service libvirtd restart 2. Create a guest and do external snapshot # cat guest.xml <domain type='kvm' id='1'> ... <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/c2.qcow2'/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> ... </domain> # virsh create guest.xml Domain cc created from guest.xml # virsh list Id Name State ---------------------------------------------------- 6 cc running # virsh snapshot-create-as cc s1 --disk-only --diskspec vda,file=/tmp/cc.s1 error: Failed to acquire lock: File exists Snapshot file created but the snapshot failed. # ll /tmp/cc.s1 -rw-------. 1 qemu qemu 2.2M Feb 4 10:17 /tmp/cc.s1 # virsh snapshot-list cc Name Creation Time State ------------------------------------------------------------ When I rm the file and create it again: # rm /tmp/cc.s1;virsh snapshot-create-as cc s1 --disk-only --diskspec vda,file=/tmp/cc.s1; error: Timed out during operation: cannot acquire state change lock Actual results: As step2 Expected results: No errors and snapshot create success. Additional info: