New-VDisk Command | Vmware PowerCLI Reference

New-VDisk

This cmdlet creates a managed VDisk object whose lifecycle is independent of a virtual machine`s lifecycle on the specified datastore. For RDM (RawVDisk), you must specify the device name of the SCSI LUN and the virtual machine host which is connected to the SCSI LUN.

Syntax

New-VDisk
-CapacityGB < Decimal >
-Datastore < Datastore >
-Name < String >
[-DiskType < DiskType > ]
[-Server < VIServer[] > ]
[-StorageFormat < VDiskStorageFormat > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
CapacityGB Decimal named
Specifies the capacity of the newly created VDisk object in gigabytes (GB).
required
Datastore Datastore named
  • pipeline
  • wildcards
Specifies the datastore on which you want to store the metadata of the VDisk object. For flat disk, the contents of the disk are also stored on the specified datastore.
required
Name String named
Specifies the name of the newly created VDisk object.
optional DiskType DiskType named
Specifies the type of the newly created VDisk object.
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 newly created VDisk object.
New-VDisk
-Datastore < Datastore >
-Name < String >
-ScsiLun < ScsiLun >
[-DiskType < DiskType > ]
[-Server < VIServer[] > ]
[-VMHost < VMHost > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Datastore Datastore named
  • pipeline
  • wildcards
Specifies the datastore on which you want to store the metadata of the VDisk object. For flat disk, the contents of the disk are also stored on the specified datastore.
required
Name String named
Specifies the name of the newly created VDisk object.
required
ScsiLun ScsiLun named
Specifies the backing SCSI LUN for the newly created VDisk object.
optional DiskType DiskType named
Specifies the type of the newly created VDisk object.
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 VMHost VMHost named
  • wildcards
Specifies the virtual machine host which is connected to the SCSI LUN.
New-VDisk
-HardDisk < HardDisk >
-Name < String >
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
HardDisk HardDisk named
  • pipeline
Specifies the virtual hard disk object which you want to promote as a VDisk object.
required
Name String named
Specifies the name of the newly created VDisk object.

Output

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

Examples

Example 1

New-VDisk -Name 'MyDisk' -CapacityGB 1 -Datastore $ds -DiskType Flat -StorageFormat Thin

Creates a new thin-provisioned flat VDisk object named 'MyDisk' on the $ds datastore with capacity of 1 GB.

Example 2

New-VDisk -Name 'MyDisk' -Datastore $ds -DiskType RawPhysical -ScsiLun $scsiLun

Creates a new physical raw VDisk object named 'MyDisk' backed by the $scsiLun SCSI LUN and with metadata on the $ds datastore.

Example 3

New-VDisk -HardDisk $hd -Name $newName

Promotes the $hd virtual hard disk to a VDisk object.

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.