rss.png profile for ebal on Stack Exchange, a network of free, community-driven Q&A sites
Jul
03
2012
Snapshot the backup/clone virtual machine

I’ve found that the best way to test something in virtualization is through snapshots.

But why snapshot the running/active virtual machine and not the backup/clone virtual machine ?


# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     winxp                          running
 -     winxpclone                 shut off

Check the clone disk format:


# qemu-img info winxpclone.disk 
image: winxpclone.disk
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: 3.1G

And remember to convert the raw disk to qcow2 first:


# qemu-img convert -f raw winxpclone.disk  -O qcow2 winxpclone.qcow2

And then edit your clone:


# virsh edit winxpclone

to use the qcow2 disk

and finally:


# virsh snapshot-create winxpclone
Domain snapshot 1341315833 created

List the snapshots:


# virsh snapshot-list winxpclone
 Name                 Creation Time             State
------------------------------------------------------------
 1341315833           2012-07-03 14:43:53 +0300 shutoff
Tag(s): libvirt, snapshot