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 -CapacityGB <Decimal> -Datastore <Datastore> [-DiskType <DiskType>] -Name <String> [-Server <VIServer[]>] [-StorageFormat <VDiskStorageFormat>] [-Confirm] [-WhatIf] [<CommonParameters>]

New-VDisk -Datastore <Datastore> [-DiskType <DiskType>] -Name <String> -ScsiLun <ScsiLun> [-Server <VIServer[]>] [-VMHost <VMHost>] [-Confirm] [-WhatIf] [<CommonParameters>]

New-VDisk -HardDisk <HardDisk> -Name <String> [-Confirm] [-WhatIf] [<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.