On 04/22/2013 06:41 PM, Gao Yongwei wrote:
2013/4/22 Hongbin Lu <hongbin034(a)gmail.com>
> Hi.
>
> A short question. I want to know what is the proper steps to create an
> image from a running domain and use it as base image of another domains.
> The domain is with Qemu Hypervisor, persistent, and created based on Ubuntu
> Cloud image.
>
> you can use qemu-img create with -b to create a new image by point its
base to the running domain image.
Careful. If the base image can still be modified, any wrapper around
the base image could be invalidated by those modifications.
The correct way is to take an external snapshot, so that the running
image now has a read-only base and a read-write layer on top of the
base; then you can create as many other qcow2 wrappers of the read-only
base to have other images based from the same point in time. However,
be aware that hot-cloning of guests is a very risky activity, because
things such as the guest's notion of its IP address is liable to cause
confusion if both guests are hooked to the same network at the same
time; yet finding all spots in memory where the guest has stashed its IP
address is difficult. For this reason, most cloning is done when a
guest is offline, or controlled so that only one branch from a clone can
ever be run at a time.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org