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

Kazuki Mizushima mizushima.kazuk at jp.fujitsu.com
Tue Apr 24 13:57:09 UTC 2007


Hi all,

I've been planing to adding cloning feature.
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
 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)

Finally, to have to communicate with the demon remotely as libvirt library, 
actually I want to put down to new libvirt API (e.g. virDomainClone).

Could you hear your comments about this ?

Attached patch shows below.
---------------------------------------------
# ./virsh --help clone
  NAME
    clone - clone a domain

  SYNOPSIS
    virsh clone <domain> <devices,...>

  DESCRIPTION
    Clone a domain.

  OPTIONS
    <domain>         shut off state domain name
    <devices>        destination devices (comma separated)

# ./virsh clone PV_RH5 /dev/sdb2
Cloning from /dev/sda5 to /dev/sdb2 .....

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

#./virsh start PV_RH5_CLONE
Domain PV_RH5_CLONE started
---------------------------------------------

Thanks,
Kazuki Mizushima
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cloning.patch
Type: application/octet-stream
Size: 6973 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070424/a33c8bd4/attachment-0001.obj>


More information about the libvir-list mailing list