[et-mgmt-tools] Idea/help with virt-clone?

Cole Robinson crobinso at redhat.com
Mon Jul 14 19:35:28 UTC 2008


Michael DeHaan wrote:
> Here's something I would like to see, but do not know how to cleanly 
> accomplish:
> 
> virt-clone -o GUESTNAME -f NEWDISKFILE -x NEWXML
> 
> The idea here is I really want to be able to clone guests, but I don't 
> necessarily want to clone them on the same host.  Instead, I want to be 
> able to track a central library of guests (and their associated disk 
> images) in cobbler that I can clone later -- in my case, koan will be 
> just doing the bare-minimum to get the virt-image parameters right to 
> feed to virt-image.  So, in order to do this, I also need to get some 
> XML out of the guest that is compatible with virt-image, so I can save 
> it on the central server.
> 
> The problem I have now is that the XML coming out of virsh dumpxml is 
> not compatible with virt-image.
> 
> This "-x" output would need to be in virt-image format and it would 
> write this XML in addition to the diskfile.
> 
> For example, once established, I could just feed this back into 
> virt-image like so:
> 
> virt-image foo.xml --n NEWNAME -u NEWUUID -m NEWMAC -b NEWBRIDGE
> 
> I do not think I'm familiar with virtinst internals to add this, though 
> it's something we are going to eventually need for ovirt.
> 
> You can see a bit of what syntax I'm getting at (and the general idea) here:
> 
> https://fedorahosted.org/cobbler/wiki/KoanWithIsos
> 
> Though in addition koan would be tracking the xmlfile for cloning info 
> as well.
> 

I think the premise is okay, but from an app separation point
of view it should be achieved a bit differently.

We could add an option to virt-clone to output the libvirt xml of
the new guest. This would be pretty simple to add.

We could then use the new virt-convert tool to convert libvirt xml
to virt-image xml. This functionality isn't present but work is
being done in this area and would not be all that difficult to
add.

This adds an extra step to your proposed process, but I think is
the sensible way to go. Converting libvirt xml to virt-image xml
is desired functionality anyways, so we want to head in this
direction.

- Cole






More information about the et-mgmt-tools mailing list