Documentation/CreateSnapshot: Difference between revisions
(Created page with '== Create a snapshot == Snapshots in QEMU are really just images that refer to another image using Copy-on-Write to avoid changing the original image. If you want to create a s…') |
|||
Line 1: | Line 1: | ||
== Create a snapshot == | == Create a snapshot == | ||
Snapshots in QEMU are | Snapshots in QEMU are images that refer to an original image using Copy-on-Write to avoid changing the original image. If you want to create a snapshot of an existing image called ''centos-cleaninstall.img'', create a new QCow2 file using the ''-b'' flag to indicate a backing file. The new image is now a read/write snapshot of the original image -- any changes to ''snapshot.img'' will not be reflected in ''centos-cleaninstall.img''. | ||
qemu-img create -f qcow2 -b centos- | qemu-img create -f qcow2 -b centos-cleaninstall.img snapshot.img | ||
== Returning to a previous version == | == Returning to a previous version == | ||
Since the snapshot is just an image file, if you want to return to the previous version, just delete ''snapshot.img'' and start using the original image again ''centos-55.img''. Please note that if you make any changes to the base image while snapshots remain, those snapshots will become corrupted. If unsure, instead of using the base image directly, just create another snapshot. | Since the snapshot is just an image file, if you want to return to the previous version, just delete ''snapshot.img'' and start using the original image again ''centos-55.img''. Please note that if you make any changes to the base image while snapshots remain, those snapshots will become corrupted. If unsure, instead of using the base image directly, just create another snapshot. |
Revision as of 18:11, 28 November 2010
Create a snapshot
Snapshots in QEMU are images that refer to an original image using Copy-on-Write to avoid changing the original image. If you want to create a snapshot of an existing image called centos-cleaninstall.img, create a new QCow2 file using the -b flag to indicate a backing file. The new image is now a read/write snapshot of the original image -- any changes to snapshot.img will not be reflected in centos-cleaninstall.img.
qemu-img create -f qcow2 -b centos-cleaninstall.img snapshot.img
Returning to a previous version
Since the snapshot is just an image file, if you want to return to the previous version, just delete snapshot.img and start using the original image again centos-55.img. Please note that if you make any changes to the base image while snapshots remain, those snapshots will become corrupted. If unsure, instead of using the base image directly, just create another snapshot.