VMware Cloud Community
daniel_uk
Hot Shot
Hot Shot
Jump to solution

VM template builds - Customise Template

Hi,

Currently am trying to adapt this script (thanks Jase) http://www.jasemccarty.com/blog/?tag=powercli to be an all encompassing script.

I want to be able to deploy VM's from a CSV file and customise the template with a Static IP, Join it to the domain etc etc, attached is my current (poor) effort...if anyone can help me then that would be really appreciated.

Thanks


Dan

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

As the error message explains, run the PowerCLI 32-bit version.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
8 Replies
LucD
Leadership
Leadership
Jump to solution

Are you getting error messages or are there parts that are not working ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
daniel_uk
Hot Shot
Hot Shot
Jump to solution

Jeez that was quick Luc Smiley Happy

Errors attached

0 Kudos
LucD
Leadership
Leadership
Jump to solution

1) it looks as if the custspec value is missing or empty.

2) is a result of 1). The OSCustomizationSpec was not found

3) the vmname value also appears to be missing

4) same as 1)

Perhaps you could show us an exampe of the CSV file you are using ?

Mask out the sensitive data first (key, name, ip...)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
daniel_uk
Hot Shot
Hot Shot
Jump to solution

Thought I should have done that....attached mate.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Ok, would have been handy if you included some data as well in the CSV extract.Smiley Wink

But still judging from the column headers there seem to be some inconsistencies:

  • there are no basevm and vmname entries in the CSV
  • the CSV entry Name probably has to be VMname
  • the sdnswins and vlan entries are not in the CSV

You should also watch out with the values you have in the CSV.

They should converted to the correct type when you use them in the cmdlet parameters.

For example, the ChangeSid parameter is a switch and expects a Boolean value in the $ChangeSid variable.

PS will convert a string with the correct content automatically to a Boolean when used on a switch parameter, but you better make sure you are using the correct text.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
daniel_uk
Hot Shot
Hot Shot
Jump to solution

arghhh i've amended but get another (attached) error...i've also put in the CSV.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

As the error message explains, run the PowerCLI 32-bit version.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
daniel_uk
Hot Shot
Hot Shot
Jump to solution

Thanks Luc for your patience, it is now all working, I had to go to 32 bit as the error said, then add a few additional required fields for domain credentials and a couple of more tweaks.

0 Kudos