book
Article ID: 337789
calendar_today
Updated On:
Issue/Introduction
Symptoms:
Deploying a Virtual Machine with more than 7 virtual disks in PowerCLI by using the cmdlet New-VM with multiple values for the parameter -DiskGB fails with error:
PowerCLI C:\> New-VM -Name sitest -ResourcePool esx002.vcloud.local -DiskGB 1,1,1,1,1,1,1,1 -DiskStorageFormat "Thin"
New-VM : 29/06/2016 13:55:17 New-VM The operation for the entity "vm" failed with the following message: "A specified parameter was not correct:
unitNumber"
At line:1 char:1
+ New-VM -Name sitest -ResourcePool esx002.vcloud.local -DiskGB 1,1,1,1,1,1,1,1 -D ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-VM], InvalidArgument
+ FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
New-VM : 29/06/2016 13:55:17 New-VM 29/06/2016 13:55:17 New-VM The operation for the entity "vm" failed with the following message: "A
specified parameter was not correct: unitNumber"
At line:1 char:1
+ New-VM -Name sitest -ResourcePool esx002.vcloud.local -DiskGB 1,1,1,1,1,1,1,1 -D ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-VM], InvalidArgument
+ FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
Environment
VMware vSphere PowerCLI 6.0
Cause
Disks created using the PowerCLI cmdlet New-VM in combination with the parameter -DiskGB are assigned consecutive node IDs: SCSI 0:0 for the first disk, SCSI 0:1 for the second disk and so on. This works fine for node IDs up to SCSI 0:6.
The ID SCSI 0:7 is reserved for the virtual SCSI controller and hence it is not available for disks.
The PowerCLI cmdlet New-VM does not have the option to define the SCSI controller on which new disks are created or the node IDs to which the disks are assigned to.
Resolution
This is a limitation of the PowerCLI cmdlet
New-VM.
Deploying a virtual machine by limiting 7 values for
-DiskGB will be successful.
To deploy virtual machines with more than 7 virtual disks in PowerCLI:
- Create new virtual machine using cmdlet New-VM with 7 values for -DiskGB parameter.
- Use the cmdlet New-HardDisk to add more disks to the virtual machine.