Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2014-02-25
4
1,536 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 119

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) earned 500 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 119
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simplivity two node omni stack 2 36
cannot remove vmnic 7 30
AWK - Blank file output zero bytes why? 18 22
convert Systemjs to Webpack 3 24
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

809 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