< Back

New-VDisk

Sun Jan 19, 2020 7:18 pm

NAME 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>]





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

-CapacityGB <Decimal>

Specifies the capacity of the newly created VDisk object in gigabytes (GB).



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? 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.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-DiskType <DiskType>

Specifies the type of the newly created VDisk object.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-HardDisk <HardDisk>

Specifies the virtual hard disk object which you want to promote as a VDisk object.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Name <String>

Specifies the name of the newly created VDisk object.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ScsiLun <ScsiLun>

Specifies the backing SCSI LUN for the newly created VDisk object.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? 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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-StorageFormat <VDiskStorageFormat>

Specifies the storage format of the newly created VDisk object.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VMHost <VMHost>

Specifies the virtual machine host which is connected to the SCSI LUN.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

The newly created VDisk objects







NOTES









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

Online Version: https://code.vmware.com/doc/preview?id= ... VDisk.html

Copy-VDisk

Get-VDisk

Move-VDisk

Remove-VDisk

Set-VDisk