[libvirt-users] Live snapshots of a single block device

Andrew Martin amartin at xes-inc.com
Thu May 22 22:31:55 UTC 2014


Hello,

I am working on a script to automatically create live snapshots of running VMs using qemu-kvm 1.4.0 and libvirt 1.0.2. If a VM has multiple disks, I'd like to back them up individually with separate calls to snapshot-create-as, so I can more easily manage the disk images. The code I have now is essentially as follows:
virsh snapshot-create-as --domain "vmname" --name "snapshotname" --description "snapshot description" --disk-only --atomic --no-metadata --diskspec "vda"

I run this command for each block device (e.g vda, vdb, etc). However, after running the above command (to only backup vda), I see that a snapshot has also been created for vdb. I tried running it with --print-xml, which gives this output:
<domainsnapshot>
  <name>05-22-14_17-09-25</name>
  <description>05-22-14_17-09-25</description>
  <disks>
    <disk name='vda'/>
  </disks>
</domainsnapshot>

What am I doing wrong - how can I tell snapshot-create-as to create an external snapshot for a specific block device only (not all block devices)?

Also, while looking at the manpage, does the --live option do anything different if used with the above command?

Thanks,

Andrew Martin




More information about the libvirt-users mailing list