Le 18. 02.
11 14:11, Matthias Bolte a écrit :
2011/2/18 Cédric Penas <cedric.penas@hesge.ch>:
Hi,
I am currently working on a project where I must develop a function to clone
domain for the driver ESX.
I immediately saw that the function cloneVM_Task () from VMware API was not
supported for standalone ESX.
Do you mean that the ESX driver doesn't use CloneVM_Task() or that the
ESX server returns an NotImplemented fault for a call to
CloneVM_Task()?
Does anyone know the best way to still implement this function or a
workaround ?
Why is it not already implemented ?
It's not implemented in libvirt, because libvirt doesn't have a
virDomainClone() function, so there is no way for the ESX driver to
use CloneVM_Task().
The virt-clone tool uses several libvirt functions to perform a clone
operation. The basics steps are:
- get the domain XML description of the domain to clone
- determine the storage volumes to clone
- issue a virStorageVolCreateXMLFrom() for each storage volume to be cloned
- update the storage volume references in the domain XML description;
remove the uuid and mac addresses to get new ones
- define a new domain from the edited domain XML description
You should be able to implement a clone operation for ESX on top of
libvirt without the need to change libvirt.
Or try to use virt-clone for ESX. IIRC virt-clone currently doesn't
handle the VMware path format properly so it might need some tweaks.
Matthias