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 - Fail to do external disk-only snapshot when guest use FC storage
Summary: Fail to do external disk-only snapshot when guest use FC storage
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 7.1
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-17 11:50 UTC by Shanzhi Yu
Modified: 2016-04-26 13:47 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:34:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
libvirtd log (9.20 MB, text/plain)
2014-04-23 07:56 UTC, Shanzhi Yu
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

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


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