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.

Bug 1088901

Summary: Fail to do external disk-only snapshot when guest use FC storage
Product: Red Hat Enterprise Linux 7 Reporter: Shanzhi Yu <shyu>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: dyuan, mzhan, rbalakri, shyu, xuzhang, yanyang
Target Milestone: rcKeywords: TestOnly
Target Release: 7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 07:34:31 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:
Description Flags
libvirtd log none

Description Shanzhi Yu 2014-04-17 11:50:50 UTC
Description of problem:

Fail to do external disk-only snapshot when guest use FC storage

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

libvirt-0.10.2-33.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.424.el6.x86_64


How reproducible:

100%

Steps to Reproduce:


1.define an mpath type pool on host with FC storage

# virsh pool-dumpxml mpath
<pool type='mpath'>
  <name>mpath</name>
  <uuid>a758ca5b-3b4b-1f01-9fb6-bbd39e4180f7</uuid>
  <capacity unit='bytes'>21481278464</capacity>
  <allocation unit='bytes'>21481278464</allocation>
  <available unit='bytes'>0</available>
  <source>
  </source>
  <target>
    <path>/dev/mapper</path>
    <permissions>
      <mode>0755</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>

# virsh vol-list mpath
Name                 Path                                    
-----------------------------------------
dm-0                 /dev/mapper/mpatha    

Create a guest storage in fc storage

# qemu-img create -f qcow2 /dev/mapper/mpatha 100G

# qemu-img info /dev/mapper/mpatha
image: /dev/mapper/mpatha
file format: qcow2
virtual size: 100G (107374182400 bytes)
disk size: 0
cluster_size: 65536

2.define a guest with storage created in step1, install an rhel6.5 OS on guest.
# virsh dumpxml test  |grep disk -A 3
    <disk type='block' device='disk'>
      <driver name='qemu' type='qcow2' cache='none' io='native'/>
      <source dev='/dev/mapper/mpatha'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>

3.after guest os boot up, create external disk-only snapshot
# virsh snapshot-create-as test s1 --disk-only --diskspec vda,file=/tmp/s1.img
error: internal error unable to execute QEMU command 'transaction': Could not open '/dev/mapper/mpatha': Permission denied

4. do external disk-only snapshot when guest is booting up

# virsh destroy test;virsh start test;virsh snapshot-create-as test s1 --disk-only --diskspec vda,file=/tmp/s1.img
Domain test destroyed

Domain test started

5. check the snapshot info

# virsh snapshot-current test
<domainsnapshot>
  <name>s1</name>
  <state>disk-snapshot</state>
  <creationTime>1397734325</creationTime>
  <memory snapshot='no'/>
  <disks>
    <disk name='vda' snapshot='external'>
      <driver type='qcow2'/>
      <source file='/tmp/s1.img'/>
    </disk>
  </disks>
  <domain type='kvm'>
..

# virsh snapshot-info test s1 
Name:           s1
Domain:         test
Current:        yes
State:          disk-snapshot
Location:       external
Parent:         -
Children:       0
Descendants:    0
Metadata:       yes


Domain snapshot s1 created


Actual results:


Expected results:

should succeed creating external disk-only snapshot when guest is running.

Additional info:


error in log:
2014-04-17 08:30:24.826+0000: 17958: error : qemuMonitorJSONCheckError:357 : internal error unable to execute QEMU command 'transaction': Could not open '/dev/mapper/mpatha': Permission denied

Comment 2 Peter Krempa 2014-04-23 07:33:51 UTC
Could you please attach the debug log of the libvirt daemon when the issue reproduces?

Comment 3 Shanzhi Yu 2014-04-23 07:56:57 UTC
Created attachment 888796 [details]
libvirtd log

Comment 9 Shanzhi Yu 2015-01-06 09:26:20 UTC
Verify this bug with libvirt-1.2.8-11.el7.x86_64
Steps as below:

1. Prepare a running domain with source file based on FC storage
# virsh dumpxml r7|grep disk -A 5 
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/dev/mapper/mpatha'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>

# virsh list 
 Id    Name                           State
----------------------------------------------------
 5     r7                             running

2. Try to create external snapshot

# virsh snapshot-create-as r7 s1 --diskspec vda,file=/var/lib/libvirt/images/r7.s1 --disk-only 
Domain snapshot s1 created
# virsh snapshot-create-as r7 s2  --diskspec vda,file=/var/lib/libvirt/images/r7.s2 --disk-only 
Domain snapshot s2 created
# virsh snapshot-create-as r7 s3 --memspec file=/var/lib/libvirt/images/r7.mem.s3   --diskspec vda,file=/var/lib/libvirt/images/r7.s3
Domain snapshot s3 created


# virsh dumpxml r7|grep disk -A 16
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/r7.s3'/>
      <backingStore type='file' index='1'>
        <format type='qcow2'/>
        <source file='/var/lib/libvirt/images/r7.s2'/>
        <backingStore type='file' index='2'>
          <format type='qcow2'/>
          <source file='/var/lib/libvirt/images/r7.s1'/>
          <backingStore type='block' index='3'>
            <format type='qcow2'/>
            <source dev='/dev/mapper/mpatha'/>
            <backingStore/>
          </backingStore>
        </backingStore>
      </backingStore>
      <target dev='vda' bus='virtio'/>
# virsh snapshot-list r7 
 Name                 Creation Time             State
------------------------------------------------------------
 s1                   2015-01-06 02:23:06 -0700 disk-snapshot
 s2                   2015-01-06 02:23:16 -0700 disk-snapshot
 s3                   2015-01-06 02:23:43 -0700 running


Succeed creating external snapshot, so verify this bug

Comment 11 errata-xmlrpc 2015-03-05 07:34:31 UTC
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://rhn.redhat.com/errata/RHSA-2015-0323.html