On 12/02/2013 05:04 PM, Juraj Melo wrote: > Hello, > > I am working on my PhD thesis and it would be really helpfull if someone > could advise me, whether can Virsh create snapshots of VMs using > copy-on-write. You might want to describe a little bit more what you want to accomplish, because, libvirt already has some advanced snapshotting mechanisms. . Here's some info about libvirt snapshots: A brief introduction of different *flavours* of snapshots (& terminology): 1) Internal Snapshots, these can be: 1.1. Internal 'disk snapshot' -- {live/offline} 1.2. Internal 'system checkpoint' snapshot -- {live} With Internal Snapshots, a single qcow2 file holds everything: original & its delta. The original file /must/ be a QCOW2 file. NOTE: 'system checkpoint' meaning -- it captures VM state and disk state. Where VM state indicates: it captures memory and device state (but not "disk" state). 2) External Snapshots, these can be: 2.1. External 'disk snapshot' -- {live/offline}. i.e: snapshot of the disk is saved in one file, and the delta since the snapshot is tracked in a new qcow2 file. 2.2. External 'system checkpoint' -- {live}. i.e: the guest's disk-state will be saved in one file, its RAM & device-state will be saved in another new file. If you want to read more about overlays with examples (and reducing snapshot chains, here's more information than ever :) -- http://kashyapc.fedorapeople.org/virt/lc-2012/snapshots-handout.html Getting started =============== If you just want to get started w/ snapshotting guests, here's how I do. I use external live snapshots, -- fastest (more on it further below): (1) List the block device associated with a guest. $ virsh domblklist f19-base Target Source --------------------------------------------- vda /export/vmimages/f19-base.qcow2 $ (2) Create external disk-only snapshot (while the guest is *running*). $ virsh snapshot-create-as --domain f19-base snap1 snap1-desc \ --disk-only \ --diskspec vda,snapshot=external,file=/export/vmimages/overlay1-of-f19-base.qcow2 \ --atomic Domain snapshot snap1 created $ NOTE-1: Once the above command is issued, the original disk-image of f19-base will become the backing_file & a new overlay image is created to track the new changes. Here on, libvirt will use this overlay for further write operations(while using the original image as a read-only backing_file). NOTE-2: You can also use a simpler command-line like below, but, you cannot specify the name & location of your overlay-file: $ virsh snapshot-create-as f19-base snap1 "snap1-desc" \ --disk-only --atomic (3) Now, list the block device associated(use command from step-1, above) with the guest, to ensure it reflects the new overlay image as the current block device in use. $ virsh domblklist f19-base Target Source ---------------------------------------------------- vda /export/vmimages/overlay1-of-f19-base.qcow2 $ Here's some more examples: http://kashyapc.fedorapeople.org/virt/lc-2012/snapshots-illustration.txt Some URLs ========= 1. http://wiki.libvirt.org/page/I_created_an_external_snapshot,_but_libvirt_won%27t_let_me_delete_or_revert_to_it 2. Notes on different kinds of snapshots -- http://kashyapc.fedorapeople.org/virt/lc-2012/snapshots-handout.html -- /kashyap _______________________________________________ libvirt-users mailing list libvirt-users@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvirt-users