I found a nice script to deploy multiple VMs at the same time on the VMware Community site. i adjusted it a lil bit to meet my needs and tested it on vSphere 6.0 Build 2997665
here is the script i Used
$esxhost = "esxhost1.domain.local"
$template = "YourTemplate"
$datastore = "DS01"
$newVmList = "TEST-SRV01", "TEST-SRV02" , "TEST-SRV03" , "TEST-SRV04"
$custSpec = "W2012R2ScustSpec"
$location = "TEST"
$taskTab = @{}
# Connect to vCenter
Connect-viserver -Server yourvcenterserver.domain.local -User domain\administrator -Password youradminpassword
# Create all the VMs specified in $newVmList
foreach($Name in $newVmList) {
$taskTab[(New-VM -Name $Name -VMHost (Get-VMHost -Name $esxName) -Template $template -Datastore $datastore -OSCustomizationSpec $custSpec -Location $location -RunAsync).Id] = $Name
}
Leave A Comment