Bug 1179533

Summary: libvirt should post accurate error when create internal snapshot with guest source file based on ceph
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.1CC: dyuan, eblake, mzhan, rbalakri, yanyang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.2.14-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 06:06:54 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:

Description Shanzhi Yu 2015-01-07 03:16:21 UTC
Description of problem:

libvirt should post accurate error when create internal snapshot with guest source file based on ceph

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

libvirt-1.2.8-11.el7.x86_64

How reproducible:

100%

Steps to Reproduce:

1. Prepare a guest with source file based on ceph
# virsh list
Id Name State
----------------------------------------------------
2 r7-ceph running


# virsh dumpxml r7-ceph |grep disk -A 10
<disk type='network' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<auth username='libvirt'>
<secret type='ceph' usage='client.libvirt secret'/>
</auth>
<source protocol='rbd' name='libvirt-pool/rhel7-rbd.img'>
<host name='10.66.xxx.xx' port='6789'/>
</source>
<backingStore/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>

2. Create internal snapshot for guest
# virsh snapshot-create-as r7-ceph s1
error: operation failed: Error -95 while writing VM


Actual results:


Expected results:

libvirt should post more accurate error since the source file guest used is raw format

Additional info:

Comment 1 Peter Krempa 2015-03-04 13:19:16 UTC
Fixed upstream:

commit f7c1410b0ee5b878e81f2eddf86c609947a9b27c
Author: Shanzhi Yu <shyu>
Date:   Sat Feb 28 17:51:36 2015 +0800

    qemu: snapshot: Don't skip check for qcow2 format with network disks
    
    When the domain's source disk type is network, if source protocol is rbd
    or sheepdog, the 'if().. break' will end the current case, which lead to
    miss check the driver type is raw or qcow2. Libvirt will allow to create
    internal snapshot for a running domain with raw format disk which based
    on rbd storage.
    
    While both protocols support internal snapshots of the disk qemu is not
    able to use it as it requires some place to store the memory image. The
    check if the disk is backed by a qcow2 image needs to be executed
    always.

v1.2.13-54-gf7c1410

Comment 3 Yang Yang 2015-05-27 09:09:07 UTC
Verified on libvirt-1.2.15-2.el7.x86_64

Steps
# virsh dumpxml vm5 | grep disk -a6
<disk type='network' device='disk'>
      <driver name='qemu' type='raw'/>
      <source protocol='rbd' name='libvirt-pool/yy1.img'>
        <host name='mon.redhat.com' port='6789'/>
      </source>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <boot order='2'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>

# virsh snapshot-create-as vm5 s1
error: unsupported configuration: internal snapshot for disk vda unsupported for storage type raw

# virsh snapshot-create-as vm5 s1 --disk-only
error: unsupported configuration: source for disk 'vda' is not a regular file; refusing to generate external snapshot name

# virsh snapshot-create-as vm5 s1 --disk-only --diskspec vda,file=/tmp/ceph.s1
Domain snapshot s1 created

Comment 5 errata-xmlrpc 2015-11-19 06:06:54 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/RHBA-2015-2202.html