Search

Method cloneVM_Task(VcFolder folder, String name, VcVirtualMachineCloneSpec spec)

Creates a clone of this virtual machine. If the virtual machine is used as a template, this method corresponds to the deploy command.

Any % (percent) character used in this name parameter must be escaped, unless it is used to start an escape sequence. Clients may also escape any other characters in this name parameter.

The privilege required on the source virtual machine depends on the source and destination types:

  • source is virtual machine, destination is virtual machine - VirtualMachine.Provisioning.Clone
  • source is virtual machine, destination is template - VirtualMachine.Provisioning.CreateTemplateFromVM
  • source is template, destination is virtual machine - VirtualMachine.Provisioning.DeployTemplate
  • source is template, destination is template - VirtualMachine.Provisioning.CloneTemplate
If customization is requested in the CloneSpec, then the VirtualMachine.Provisioning.Customize privilege must also be held on the source virtual machine.

The Resource.AssignVMToPool privilege is also required for the resource pool specified in the CloneSpec, if the destination is not a template. The Datastore.AllocateSpace privilege is required on all datastores where the clone is created.

Returns

VcTask

Arguments

Name Type Description
folder VcFolder The location of the new virtual machine.
name String The name of the new virtual machine.
spec VcVirtualMachineCloneSpec Specifies how to clone the virtual machine.