Search

Method copyVirtualDisk_Task(String sourceName, VcDatacenter sourceDatacenter, String destName, VcDatacenter destDatacenter, VcVirtualDiskSpec destSpec, boolean force)

Copy a virtual disk, performing conversions as specified in the spec.

If source (or destination) name is specified as a URL, then the corresponding datacenter parameter may be omitted.

If source and destination resolve to the same file system location, the call has no effect, regardless of destSpec content.

Requires Datastore.FileManagement privilege on both source and destination datastores.

Returns

VcTask

Arguments

Name Type Description
sourceName String The name of the source, either a datastore path or a URL referring to the virtual disk to be copied.
sourceDatacenter VcDatacenter If <code>sourceName</code> is a datastore path, the datacenter for that datastore path. Not needed when invoked directly on ESX. If not specified on a call to VirtualCenter, <code>sourceName</code> must be a URL.
destName String The name of the destination, either a datastore path or a URL referring to the virtual disk to be created.
destDatacenter VcDatacenter If <code>destName</code> is a datastore path, the datacenter for that datastore path. Not needed when invoked directly on ESX. If not specified on a call to VirtualCenter, it is assumed that the destination path belongs to the source datacenter.
destSpec VcVirtualDiskSpec The specification of the virtual disk to be created. If not specified, a preallocated format and busLogic adapter type is assumed.
force boolean The force flag is currently ignored. The FileAlreadyExists fault is thrown if the destination file already exists.