Hi,
i'm using a powershell script to deploy vms based on csv file (orig script here https://blog.smasterson.com/2014/05/21/deploying-multiple-vms-via-powercli-updated-v1-2/).
i'm using 3 different vcenter servers (selected by params in the csv).
2 are ok but the third recently start failing with vm exist.
the thing is that the vm doesn't exist until the new-vm command (i'm checking it right before the new-vm).
if (Get-VM -Name $vmName -Location $cluster -Server $vcserver |Select Name) {
Out-Log "Line 292: $vmName Exist, Moving to next one" "Red"
Continue
}
$taskTab[(New-VM -Name $VM.Name -Server $vcserver -VMHost $vmhost.Name -Location $VM.Folder -Datastore $datastore -Notes $notes -VM $VM.Template -OSCustomizationSpec $tempSpec -RunAsync).Id] = $tid
when the new-vm task starting i see that there is a line in the vc recent tasks of the clone, but 2 seconds later there is another attempt and fail with the vm exist error.
i can't find any thing that will explain this behavior, not in the script and not in the vc logs.
any thoughts/ideas?
thanks
mor