[libvirt-users] Snapshot Error

Eric Blake eblake at redhat.com
Wed Sep 28 17:00:50 UTC 2011

On 09/26/2011 08:31 PM, huachao yao wrote:
> Hey
> When I want to take a snapshot for a Domain by using
> virDomainSnapshotCreateXML. The Error as below happen:
> libvir: QEMU error : Requested operation is not valid: Disk
> '/var/lib/libvirt/images/fedora-qcow.qcow2' does not support snapshotting

Can you also post the XML of the domain, as in 'virsh dumpxml dom'?  I 
suspect that your xml is either omitting the driver type (making libvirt 
have to probe, if qemu.conf allows probing, which is a security risk), 
or calling out raw instead of qcow2 (as in the following example):

     <disk ...>
       <driver name='qemu' type='qcow2'/>

Libvirt refuses to do system checkpoints with internal disk snapshots if 
a disk is not explicitly qcow2, which explains the message you are getting.

> The snapshot Configuration is :
> <domainsnapshot>
>    <description>Snapshot of OS install and updates</description>
>    <disks>
>      <disk name='/var/lib'>
>        <source file='/var/lib-snapshot'/>
>      </disk>
>      <disk name='vdb' snapshot='no'/>
>    </disks>
> </domainsnapshot>

This makes it look like you are trying to do a disk snapshot.  Are you 
passing the VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY flag?  If so, your 
error message doesn't make sense (that requests external snapshots, 
which don't have a restriction on a qcow2-only source).  If not, it 
means your <disks> designation is being ignored (without the DISK_ONLY 
flag, you are requesting a system checkpoint, which currently uses 
internal disk snapshots without regards to any <disks> element).

> And /var/lib/libvirt/images/fedora-qcow.qcow2 is the disk for the domain
> (use qemu-img to create). And I had tried another Disk format
> (*.img), but the error still happen. how can i deal with this error??
> PS:qemu version is 0.14&  libvirt version is 0.9.4.  Pls help.   :-(

Oh, 0.9.4 doesn't have the DISK_ONLY flag, and doesn't know how to parse 
<disks> in the first place.  For that, you need 0.9.5 or newer.

Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

More information about the libvirt-users mailing list