[libvirt-users] Create image from running domain

Eric Blake eblake at redhat.com
Tue Apr 23 12:26:51 UTC 2013


On 04/22/2013 06:41 PM, Gao Yongwei wrote:
> 2013/4/22 Hongbin Lu <hongbin034 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20130423/330a3e77/attachment.sig>


More information about the libvirt-users mailing list