• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1821
  • Last Modified:

Script to deploy multiple VMs from a template vsphere/vcenter 5.5

hello,

I was hoping to get assisting in creating a powerCLI script (also open to other methods) to  deploy multiple VMs from a template hosted on vCenter 5.5

need the script to perhaps do the following:

- run sysprep
- assign vmhost-name
- assign vmhost-ip
- join vmhost to domain (and the correct OU)

thank you very much
0
mshalabi
Asked:
mshalabi
  • 2
  • 2
1 Solution
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Is Deployment from Template using existing Customizations Specifcations not automated enough, using vCenter Server ?

1. Define your Customization Specifications e.g. Deploy1

Customization specification, will contain, the  

   vmhost-name
   vmhost-ip
  join vmhost to domain (and the correct OU)

and Custom Spec will do the Generate new Sid, and Sysprep.

You need to ensure, you create your golden master template


and then, execute the following PowerCLI, with Deploy1 as the spec.

$spec = Get-OSCustomizationSpec –Name <spec name>
Get-Template <template name> | New-VM –Name <target-vm-name> -VMHost <name of vmhost> -Datastore <name of datastore> -OSCustomizationSpec $spec

Open in new window

0
 
mshalabiAuthor Commented:
Andrew,

Thank you for your respond.  This makes sense, but how would I go about deploying more than one VM from that master template with different IPs and hostnames ?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Multiple Customization Specifications!

Spec1
Spec2
Spec3...

or use DHCP and Set IP Addresses via Mac Address.

Call script with Spec1
Call script with Spec2
0
 
mshalabiAuthor Commented:
thank you
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now