Copy-VDisk Command | Vmware PowerCLI Reference

Copy-VDisk

This cmdlet copies the specified VDisk objects to the specified datastore. For RDM (RawVDisk), only one VDisk can be copied at once, and only copying from VMFS to VMFS is supported.

Syntax

Copy-VDisk
[ -Datastore ] < Datastore >
-VDisk < VDisk[] >
[-Name < String > ]
[-RunAsync ]
[-Server < VIServer[] > ]
[-StorageFormat < VDiskStorageFormat > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Datastore Datastore 1
  • wildcards
Specifies the datastore to which you want to copy the metadata of the VDisk object. For flat disk, the contents of the disk are also copied to the specified datastore.
required
VDisk VDisk[] named
  • pipeline
Specifies the VDisk objects you want to copy.
optional Name String named
Specifies the name of the copy of the VDisk object.
optional RunAsync SwitchParameter named
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the VMware PowerCLI console.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
optional StorageFormat VDiskStorageFormat named
Specifies the storage format of the copy of the VDisk object.
Copy-VDisk
[ -Datastore ] < Datastore >
-ScsiLun < ScsiLun >
-VDisk < VDisk[] >
[-Name < String > ]
[-RunAsync ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Datastore Datastore 1
  • wildcards
Specifies the datastore to which you want to copy the metadata of the VDisk object. For flat disk, the contents of the disk are also copied to the specified datastore.
required
ScsiLun ScsiLun named
Specifies the backing SCSI LUN for the copy of the VDisk object.
required
VDisk VDisk[] named
  • pipeline
Specifies the VDisk objects you want to copy.
optional Name String named
Specifies the name of the copy of the VDisk object.
optional RunAsync SwitchParameter named
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the VMware PowerCLI console.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.

Output

VMware.VimAutomation.ViCore.Types.V1.Storage.VDisk.VDisk

Examples

Example 1

Copy-VDisk -VDisk $vDisk -Datastore $ds

Copies the flat VDisk object $vDisk on the $ds datastore.

Example 2

Copy-VDisk -VDisk $vDisk -ScsiLun $scsiLun -Datastore $ds

Copies the raw VDisk object $vDisk on the $scsiLun SCSI LUN and stores metadata of this object on the $ds datastore.

Related Commands

VDisk

This cmdlet copies the specified VDisk objects to the specified datastore.

This cmdlet lists VDisk objects based on the specified filters.

This cmdlet moves the specified VDisk objects to the specified datastore.

This cmdlet creates a managed VDisk object whose lifecycle is independent of a virtual machine`s lifecycle on the specified datastore.

This cmdlet removes VDisk objects and the associated backings from the datastore.

This cmdlet renames, inflates, or extends the size of the specified VDisk object.