Hi Luc,
Thanks for the reply. I have attached the script and the csv file to this thread. The script works just fine for deploying 1 or multiple VMs. The only issue I have seen so far is I get a weird error at the start of the script but it does not prevent from creating VMs.
New-VM : 3/9/2016 12:34:21 PM New-VM An item with the same key has already been added. At
C:\source\scripts\aws\vm-deploy_3.0.ps1:50 char:2
+ New-vm -VMhost $ClusterHost -Name $VM.VMName -ResourcePool $VM.ResourcePool -D ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-VM], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
The real issue is with adding Disk2 from the CSV file. If I include Disk2 and Disk3 in the csv file, only Disk3 gets added to the VM. Disk2 is not getting added and it returns this error message. The strange thing is in the past I have seen this work with both Disk2 and Disk3 but just recently it is not working with Disk2 at all. I am not sure what changed?
New-HardDisk : 3/9/2016 12:42:33 PM New-HardDisk The operation for the entity VirtualMachine-vm-1002504
failed with the following message: "A specified parameter was not correct.
" At C:\source\scripts\aws\vm-deploy_3.0.ps1:78 char:16
+ $gVM | New-HardDisk -CapacityGB $Disk2 -Persistence persistent -StorageF ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-HardDisk], InvalidArgument
+ FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation
.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk
Can you provide some guidance.