[libvirt] Is there an API for clone?

Richard W.M. Jones rjones at redhat.com
Wed Nov 10 22:20:56 UTC 2010


On Wed, Nov 10, 2010 at 10:42:27AM +0000, Daniel P. Berrange wrote:
> On Wed, Nov 10, 2010 at 09:30:28AM +0800, 黄亮 wrote:
> > Hi, guys
> > 
> > I know there is a command "virt-clone", but I couldn't find the 
> > equivalent API here : http://libvirt.org/html/libvirt-libvirt.html
> > So, is there an API to clone an existing VM or not?
> 
> The virt-clone tool is implemented by running a large number of
> individual libvirt APIs. There's no API that does everything in
> one go, because that would be an application specific use case.

In addition you can't clone a VM just using libvirt APIs:

https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/

On Windows you'd probably want to run the sysprep program.

This is a bug in the virt-clone tool:

https://bugzilla.redhat.com/show_bug.cgi?id=524269

And for completeness:

https://bugzilla.redhat.com/show_bug.cgi?id=638188

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top




More information about the libvir-list mailing list