VMware Cloud Community
Stephanevg
Contributor
Contributor

Create a VM using a unattend.xml

Hi guys,

I have been using New-OSCustomizationSpec in order to create and simulate the creation of the Unattend.xml file until now.

I have faced an issue which makes me re-consider this approach, and I am asking my self it if is possible to deploy a machine based on VMTemplate using a Predefined XML.

The Idea is to dynamically create the XML structure in memory based on a template, and simply change some specefic values.

I bumped into this thread of VOrechestrator, which seams to do what I am thinking of doing, but I coudln't find anything similar directly with PowerCLI (Or other API calls).

Is there  solution for me in order to provision a VM with a paramter -UnattendFile (Or something similar?)

Thanks for the feedback!

Stéphane

5 Replies
LucD
Leadership
Leadership

Afaik there isn't, but you can use an sysprep.inf to feed to your customisationspec, see the CustomizationSysprepText object.

But there aren't many samples on how to use this available it seems.


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

0 Kudos
Stephanevg
Contributor
Contributor

ok, that sounds promising.

I tried to create an object, using the following command, but kept having an error though.

PS D:\Working\MyUser\SDB-OPR-NewVM> new-object vim.vm.customization.SysprepText

new-object : Cannot find type [vim.vm.customization.SysprepText]: verify that the assembly containing this type is loaded.

Any idea in which assembly the type is located?

0 Kudos
LucD
Leadership
Leadership

That should be

New-Object VMware.Vim.CustomizationSysprepText


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

0 Kudos
Stephanevg
Contributor
Contributor

Great, I got it to work!
Thanks for giving me the right hint @lucd . Since there was a lack of documentation on it on the internet, I have decided to write a detailed article about it --> http://powershelldistrict.com/how-to-deploy-a-vm-using-powercli-and-unattend-xml/ (Feedback appreciated ;))

I magine this would be helpfull for other people in the futur.

Thanks again!

LucD
Leadership
Leadership

Thanks for sharing that!


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

0 Kudos