Bug 1304579 - Failed to take external snapshot when enable sanlock
Failed to take external snapshot when enable sanlock
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
Depends On: 1191901
Blocks: 1305793
  Show dependency treegraph
Reported: 2016-02-03 21:27 EST by Han Han
Modified: 2016-02-15 06:50 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1305793 (view as bug list)
Last Closed: 2016-02-15 06:50:35 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
The log of step2 (149.43 KB, text/plain)
2016-02-03 21:27 EST, Han Han
no flags Details

  None (edit)
Description Han Han 2016-02-03 21:27:53 EST
Created attachment 1121017 [details]
The log of step2

Description of problem:
As summary

Version-Release number of selected component (if applicable):

How reproducible:

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                                              

# 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'/>

# 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:

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