Creating a new Raw Device Mapping using New-VDisk fails in PowerCLI when run against vSphere 6.x/7.x
search cancel

Creating a new Raw Device Mapping using New-VDisk fails in PowerCLI when run against vSphere 6.x/7.x

book

Article ID: 326249

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
Attempts to create an RDM in vSphere 6.7 or an a vSphere 7.0 version older than Update 1 using the PowerCLI cmdlet New-VDisk with the option "-DiskType RawPhysical" fail with the following error message:
New-VDisk : 5/20/2020 2:12:59 PM New-VDisk A specified parameter was not correct: spec.capacityInMB
At line:1 char:1
+ New-VDisk -Name 'MyDisk' -Datastore $ds -disktype RawPhysical -scsilu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-VDisk], InvalidArgument
+ FullyQualifiedErrorId : StorageImpl_VDisk_NewVDisk_CreationFailed,VMware.VimAutomation.Storage.Commands.Cmdlets.VDisk.NewVDisk


Environment

VMware vSphere 7.0.x
VMware vSphere 6.7.x

Resolution

This issue has been fixed in vSphere 7.0 Update 1
If you are experiencing the problem in vSphere 6.7, please upgrade to vSphere 7.0 U1 or newer, or use the workaround as described below


Workaround:
Instead of using the New-VDisk cmdlet to create Raw Device Mappings (RDM), you can alternatively use New-HardDisk which works with the same option "-DiskType RawPhysical" to create new RDMs.

Additional Information

For more information on the New-HardDisk cmdlet, please refer to https://code.vmware.com/docs/11794/cmdlet-reference/doc/New-HardDisk.html