Method registerVM_Task(String path, String name, boolean asTemplate, VcResourcePool pool, VcHostSystem host)

Adds an existing virtual machine to the folder.

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.

This operation only works if the folder's type is VirtualMachine. In addition to the VirtualMachine.Inventory.Register and Resource.AssignVMToPool privileges, it requires System.Read privilege on the datastore that the existing virtual machine resides on.




Name Type Description
path String A datastore path to the virtual machine.
name String The name to be assigned to the virtual machine. If this parameter is not set, the displayName configuration parameter of the virtual machine is used. An entity name must be a non-empty string of less than 80 characters. The slash (/), backslash (\) and percent (%) will be escaped using the URL syntax. For example, %2F.
asTemplate boolean Flag to specify whether or not the virtual machine should be marked as a template.
pool VcResourcePool The resource pool to which the virtual machine should be attached. If imported as a template, this parameter is not set.
host VcHostSystem The target host on which the virtual machine will run. This parameter must specify a host that is a member of the ComputeResource indirectly specified by the pool. For a stand-alone host or a cluster with DRS, the parameter can be omitted, and the system selects a default.