Hi Friends,
I'm looking for the PowerCLi script which can automate VM provisioning without using template.
User Input will be Hostname, Manual mac ,CPU and Mem..
Solution :
Create a VM using (NewVM) ---> then install the Guest OS (Anyone)
Thx, Waiting for the response.
You will need at least to give an ESXi hosts as well.
Something like this should do it
$esxName = "MyEsx"
Import-Csv input.csv -UseCulture | %{
$vm = New-VM -Name $_.Hostname -NumCPU $_.CPU -MemoryMB $_.MemoryGB -VMHost $esxName
Get-NetworkAdapter -VM $vm | Set-NetworkAdapter -MacAddress $_.MAC
}
And for the CSV file it assumes a layout like this
"Hostname","CPU","MemoryGB","MAC"
"testVM","1","2","11:22:33:44:55:66"
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Lucd,
Thanks for the info. How the script will pickup the data store and stuff...
I'm a beginner to PowerCLi , Please let me know the complete script.
If you don't specify values for parameters, like for example the datastore, the defaults will be taken.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Great.Let me try out and let you know the results.
Thanks a lot.