Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Deploy Multiple VM's with PowerCLI

Posted on 2014-03-30
26
Medium Priority
?
663 Views
Last Modified: 2014-03-30
i am trying to deploy multiple vm's using powercli but encounter errors with my configuration.

Please advise
VM.PNG
error.PNG
0
Comment
Question by:Jorge Ocampo
[X]
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
  • 13
  • 13
26 Comments
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965170
Did you try putting the name of the template in quotes?

E.g: command -template "name of template" ...
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965172
Just tried it and it didn't work.

New Error
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965175
Yeah, but that's a different error now ... It's looking for a OSCustomizationSpec with the name 'QAVM Template v3.0'... Is this correct? Doesn't seem to find it.

Remember to put quotes on all the names containing spaces.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965179
error3Now it closer to being fixed, it ran till 99% and failed. I'm assuming it has something to do with the OSCustomizationSpec I have specified in that template to ask me for the NETBIOS/HOSTNAME and IP Address but in command line I wont be prompted any ideas?
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965195
hmmmm it seems to complain about a parameter not being correct, something about a hostname... what if you omit the vmhost part of the command? Might need to adjust the script to first connect to the host then though ...
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965198
i'm a little confused

Appreciate your help!
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965199
Here is my scrypt:

New-vm -vmhost 10.8.30.18 -Name HIGH5-QATEST9-New -Template "QAVM Template v3.0" -Datastore MD1200_1 -OSCustomizationspec "QA Template"
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965204
Ok ... Might need to rethink it ...

What if you adjust the script to something like this:

New-VM -VMHost Your-VM-Host -Name Your-VM-Name -Template "Your Template" -Datastore Your-Data-Store | Set-VM -OSCustomizationSpec "Your Template Spec"  

Open in new window


What's the version of your PowerCLI? (Get-PowerCLIversion)
0
 
LVL 25

Accepted Solution

by:
Zephyr ICT earned 2000 total points
ID: 39965207
So that would be something like this:

New-vm -vmhost 10.8.30.18 -Name HIGH5-QATEST9-New -Template "QAVM Template v3.0" -Datastore MD1200_1 | set-vm  -OSCustomizationspec "QA Template"

Open in new window


If you want to try a script before really running it, you can normally add -WhatIf behind it, like so:

New-vm -vmhost 10.8.30.18 -Name HIGH5-QATEST9-New -Template "QAVM Template v3.0" -Datastore MD1200_1 | set-vm  -OSCustomizationspec "QA Template -WhatIf"

Open in new window

0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965208
VMWare AutoDeploy PowerCLI Component 5.5 build 1262826
VMWare ImageBuilder PowerCLI Component 5.5 build 12628
VMware License PowerCLI Component 5.5 build 1265954
VMware VDS PowerCLI Component 5.5 build 1295334
VMware vSphere PowerCLI Component 5.5 build 1295334
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965209
Whatif? inside quotes?
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965220
No, sorry -whatif without quotes ...
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965222
this is what I got with what if

PowerCLI C:\users\jocampo\desktop> .\Bulk.ps1
What if: Proceed to configure the following parameters of the virtual machine wi
th name 'HIGH5-QATEST10-New'?

would that be the computer name?
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965228
That would be the VM the script created with that name yes ... If the script was run without the WhatIf.
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965234
New-vm -vmhost 10.8.30.18 -Name HIGH5-QATEST10-New -Template "QAVM Template v3.0" -Datastore MD1200_1 | set-vm  -OSCustomizationspec "QA Template" -WhatIf

this what I have and it still created the vm
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965241
Hmm strange ... Did it run the Customization?

Might be because the -WhatIf is behind that pipe ... I'd need to test that but can't at the moment, sorry to say.
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965252
There should be a possibility to run this though ... Just need to test it out myself, or find it online :)
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965249
ill just have to adjust the customization to no prompt for hostname or ip address and I will need to do those changes after every machine is build.
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965255
unless you have any other suggestions?
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965261
The thing is, the original script should work, I'm not seeing the problem with the hostname, can't it be resolved, where exactly does it ask this hostname if you run it manually?
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965266
You could first deploy the VM's with the first part of your script, then run a new script for just the customizations...

Something like this

Get-VM vm-name | Set-VM -OSCustomizationSpec name-of-spec

Open in new window

0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965267
Manually on VSphere Client.

1. Deploy Machine from Template - I specified tree name
2. Pick a host from the cluster
3. pick vm store
4. customize using an exisiting customication specification - I pick "QA Template"
5.prompt
now the problem is that in command line I am not asked those questions.
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965288
Yeah, we'll need a little more comprehensive script for this I'm afraid ... I'll need to look into it a little more ... But I'm signing of for the night right now ... Sorry I couldn't help more.
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 39965292
No need to apologize you were a tremendous help, I appreciate all your help.
0
 
LVL 2

Author Closing Comment

by:Jorge Ocampo
ID: 39965294
Amazing Engineer!
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39965881
Thanks!!
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This Micro Tutorial walks you through using a remote console to access a server and install ESXi 5.1. This example is showing remote access and installation using a Dell server. The hypervisor is the very first component of your virtual infrastructu…
In this video tutorial I show you the main steps to install and configure  a VMware ESXi6.0 server. The video has my comments as text on the screen and you can pause anytime when needed. Hope this will be helpful. Verify that your hardware and BIO…

636 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