qemusnapshotkvmlibvirtopennebula

How to create an external snapshot with virsh snapshot-create-as...?


When I try to create a snapshot with

virsh snapshot-create-as one-217 snap_base "desc" --diskspec vda,file=/var/lib/one/datastores/1/2aae91bd6c04fa2db0849bc0db1342ba --disk-only --atomic

There is an error occurred.

error: unsupported configuration: external snapshot file for disk vda already exists and is not a block device: /var/lib/one/datastores/1/2aae91bd6c04fa2db0849bc0db1342ba

Then I run

virsh snapshot-list one-217

There is no snapshot displayed for one-217.

I run

virsh domblklist one-217

Result like this vda /var/lib/one//datastores/0/217/disk.0 hda /var/lib/one//datastores/0/217/disk.1

I am confused. How can I create an external snapshot with virsh snapshot-create-as command or I should try another way? And how to create a multi disk snapshot?

virsh version is Compiled against library: libvirt 0.10.2 Using library: libvirt 0.10.2 Using API: QEMU 0.10.2 Running hypervisor: QEMU 0.12.1

Could anyone help me please? Thx in advance!


Solution

  • Seems like the file 2aae91bd6c04fa2db0849bc0db1342ba already exists, so the error message you see is valid -- libvirt was rightly refusing to use an existing file, because that can cause data loss. Here's the relevant bug, which is fixed in upstream libvirt.

    To resolve that, try providing path to a file that does not exist: /var/lib/libvirt/images/snap1-one-217.qcow2 (or something like that).

    And, judging from the error, your libvirt version seems to be old. Please use a relatively newer version (or at-least a version above libvirt-0.9.10).