PowerCLI Reference

New-VDisk

Synopsis

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

Syntax

New-VDisk -Name <String> [-StorageFormat <VDiskStorageFormat>] -CapacityGB <Decimal> [-DiskType <DiskType>] -Datastore <Datastore> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
New-VDisk -Name <String> [-DiskType <DiskType>] [-VMHost <VMHost>] -Datastore <Datastore> -ScsiLun <ScsiLun> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
New-VDisk -Name <String> -HardDisk <HardDisk> [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Copy-VDisk
Get-VDisk
Move-VDisk
Remove-VDisk
Set-VDisk

Detailed Description

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.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
CapacityGBDecimalSpecifies the capacity of the newly created VDisk object in gigabytes (GB).truefalse
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
DatastoreDatastoreSpecifies 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.truetrue (ByValue)
DiskTypeDiskTypeSpecifies the type of the newly created VDisk object.falsefalse
HardDiskHardDiskSpecifies the virtual hard disk object which you want to promote as a VDisk object.truetrue (ByValue)
NameStringSpecifies the name of the newly created VDisk object.truefalse
ScsiLunScsiLunSpecifies the backing SCSI LUN for the newly created VDisk object.truefalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse
StorageFormatVDiskStorageFormatSpecifies the storage format of the newly created VDisk object.falsefalse
VMHostVMHostSpecifies the virtual machine host which is connected to the SCSI LUN.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

The newly created VDisk objects

Notes

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.


Copyright © VMware, Inc. All rights reserved.