Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1088901 - Fail to do external disk-only snapshot when guest use FC storage
Fail to do external disk-only snapshot when guest use FC storage
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: 7.1
Assigned To: Peter Krempa
Virtualization Bugs
: TestOnly
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-17 07:50 EDT by Shanzhi Yu
Modified: 2016-04-26 09:47 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:34:31 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description Shanzhi Yu 2014-04-17 07:50:50 EDT
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 03:33:51 EDT
Could you please attach the debug log of the libvirt daemon when the issue reproduces?
Comment 3 Shanzhi Yu 2014-04-23 03:56:57 EDT
Created attachment 888796 [details]
libvirtd log
Comment 9 Shanzhi Yu 2015-01-06 04:26:20 EST
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 02:34:31 EST
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.