Provision multiple VMs from template via PowerCLI

 

OK, so first of all u need to have so things:

1. a VM Template that is already pre configured

2. if you are foing to use windows 2003, xp, u need the sysprep files installed on the vCenter.

3. last thing is a Customization Specification file which is actually ….an answer file to run during the sysprep proccess.

on this example i am using a template name “Template” and a OS Customization file name win2003Prep

i will provision 5 vm’s from a single command with vm000X as naming convention.

Steps:;

a. open powerCli and connect to your vCenter Server:

connect-viserver -server vCenterName -username ‘administrator’ – password ‘password’

b. now u can create multiple VMs from you template using a single command:

# 1..5 | foreach { new-vm -name vm000$_ -vmhost esxi1.vmwarepro.com -Datastore SharedDS -template Template -oscustomizationSpec win2003Prep } | start-VM

c. at this point the vCenter will clone the Template 5 times and will activate the sysprep process.

Regards,

Shay Hyams

Advertisements

One comment on “Provision multiple VMs from template via PowerCLI

  1. Pingback: Loginvsi and the Launchers from Hell

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s