Hi there!
The clone VM task has already been implemented in pysphere 0.1.5,
make sure you have the last version of pysphere.
> vm = server.get_vm_by_path(vmpath)
>
> vm2 = vm.clone("The new vm name")
> vm2.get_status()
You might pass some optional additional parameters. Here's the method
docuentation:
def clone(self, name, sync_run=True, folder=None, power_on=True):
"""Clones this Virtual Machine
@name: name of the new virtual machine
@folder: name of the folder that will contain the new VM, if
not set
the vm will be added to the folder the original VM
belongs to
@power_on: If the new VM will be powered on after being
created
@sync_run: if True (default) waits for the task to finish, and
returns
a VIVirtualMachine instance with the new VM (raises an
exception if the
task didn't succeed). If sync_run is set to False the task is
started an
a VITask instance is returned
"""
Regards,
Sebastian
> self._retrieve_properties_traversal(property_names=['name'],from_node=node, obj_type='VirtualMachine')