## 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

Name | Type | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | --- | ---
CapacityGB | Decimal | Specifies the capacity of the newly created VDisk object in gigabytes (GB). | true | false
Confirm | SwitchParameter | If 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. | false | false
Datastore | Datastore | 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. | true | true (ByValue)
DiskType | DiskType | Specifies the type of the newly created VDisk object. | false | false
HardDisk | HardDisk | Specifies the virtual hard disk object which you want to promote as a VDisk object. | true | true (ByValue)
Name | String | Specifies the name of the newly created VDisk object. | true | false
ScsiLun | ScsiLun | Specifies the backing SCSI LUN for the newly created VDisk object. | true | false
Server | VIServer[] | 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. | false | false
StorageFormat | VDiskStorageFormat | Specifies the storage format of the newly created VDisk object. | false | false
VMHost | VMHost | Specifies the virtual machine host which is connected to the SCSI LUN. | false | false
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false

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.