[Libvir] [PATCH][RFC] Adding Cloning Feature

Richard W.M. Jones rjones at redhat.com
Tue Apr 24 14:11:33 UTC 2007


Kazuki Mizushima wrote:
> I've been planing to adding cloning feature.

I think cloning is a great feature.  From when I used to sysadmin a Xen 
server, I used cloning as the main technique to create new servers - ie. 
take an existing machine which is similar to the new one which I want, 
and just clone it.

> Then, I tried to make the patch in the following way.
> 1)Get the XML used virDomainGetXMLDesc
> 2)Delete <uuid>, <mac> node element
>   This intened to automatically generated.
> 3)Changing <name>, <source dev> string node element
> 4)Fork "dd" process

You may want to pause the source node first?  Otherwise won't you get 
disk corruption?

Also, what about other devices?  You "dd" the main disk, but what if the 
machine has swap devices or other disks?

> 5)Define XML used virDomainDefineXML
> 
> This feature is just a first revision, because I make this patch within 
> current libvirt API limitation.
> Also Remote Cloining is Limited.
> But if we can libvirtd for feature, it will be enhance remote cloning
> based on this pach
> (as http://libvirt.org/remote.html#Remote_libvirtd_configuration)

There is no problem with interaction with the remote patch.  Nor do you 
have to worry about the remote stuff when implementing this (the "dd" 
will fork on the remote libvirtd automagically).

... Unless you want to clone across servers :-)

... a.k.a. migration, and of course we haven't really worked out how we 
should do that (but if you have ideas, please post them).

> # ./virsh list --all
> Id Name                 State
> ----------------------------------
>  0 Domain-0             running
>  - PV_RH5               shut off
>  - PV_RH5_CLONE         shut off

So the idea is that you can only clone an inactive domain?

Rich.

-- 
Emerging Technologies, Red Hat  http://et.redhat.com/~rjones/
64 Baker Street, London, W1U 7DF     Mobile: +44 7866 314 421

Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.
Registered in England and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David
Owens (Ireland)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070424/dced447c/attachment-0001.bin>


More information about the libvir-list mailing list