How to create multiple vms using powercli

powershell script to create multiple vms in VMware cluster

 

 

connect-viserver vcenter01 -user administrator@vsphere.local -password VMware1!

Write-host “No of VMs to deploy”

$noofvms=Read-host

write-host “Enter the naming convention”

$vmaname=read-host

for($count=0;$count -le ($noofvms-1);$noofvms++)

{

new-vm -name ($vmname+$count) -vmhost (get-cluster cluser01|get-vmhost|get-random) -disksizemb 100 -portgroup vlan100

}

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.