Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-02-25
4
Medium Priority
?
1,796 Views
Last Modified: 2014-03-10
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
Comment
Question by:mshalabi
  • 2
  • 2
4 Comments
 
LVL 124

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) earned 2000 total points
ID: 39886882
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
 

Author Comment

by:mshalabi
ID: 39886941
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
 
LVL 124
ID: 39886988
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
 

Author Closing Comment

by:mshalabi
ID: 39918324
thank you
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question