VMware Cloud Community
AllanChristians
Enthusiast
Enthusiast

OSCustomizationSpec

Hi,

After that VI toolkit is GA i looked forward to Custspec working.

But i have problems passing information to $Custscript object. In the GUI i fill in Hostname and IP and it works like a charm. but here in the script i have trouble finding out how to pass these information on to the object

$newvmname = "newhostname"
$Template = Get-template "W2k3r2"
$Custscript = Get-OSCustomizationSpec -name "STD_SRV"
$respool = get-resourcepool -name DEPLOY
$vmhost = get-vmhost ESX101
$Datastore = get-datastore -name Datastore10
New-VM -Name $newvmname -VMHost $vmhost -datastore $Datastore -Template $Template -OSCustomizationSpec $Custscript

If i run the same script without the OSCustomizationSpec part then it works like a charm.

/Allan

/Allan http://doitsmarter.blogspot.com
0 Kudos
9 Replies
LucD
Leadership
Leadership

You're not alone Smiley Sad

Unfortunately the latest VITK build still seems to have some shortcomings in the OSCustomizationSpec.

Do a find on 'OSCustomizationSpec" in this community and you will see what I mean.


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

0 Kudos
Niket
Enthusiast
Enthusiast

Hi,

Bug has been opened and engg team is working on this issue.

Thanks

Niket

0 Kudos
AllanChristians
Enthusiast
Enthusiast

Do you have an update on this?

/Allan

/Allan http://doitsmarter.blogspot.com
0 Kudos
drexciya
Enthusiast
Enthusiast

To make things even more strange I've had the exact same script fail on me with Windows 2003 Server and run fine with XP Professional.

Really odd. In The VCenter Logs there seems to be a problem with some setting. I've already changed some settings so I don't have problems

with encrypted passwords.

Just the New-VM part of the script without the variables:

New-VM -VMHost $Server -Template $Sjabloon -Resourcepool $Pool -Datastore $Store -OSCustomizationSpec $Specification -Name $VMName -Location $Locatie -Confirm:$False

0 Kudos
LucD
Leadership
Leadership

Do you have the sysprep files for Windows 2003 installed on your VC ?

See Appendix B in Basic System Administration.


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

0 Kudos
drexciya
Enthusiast
Enthusiast

Off course I do, I've deployed machines manually from both templates as well.

The Customization Specification used was a previously exported one that was slightly

changed (no encrypted password) and then imported into this VirtualCenter environment.

I'll have a look at the VirtualCenter logs to see what comes up there, I remember something like

"unable to read ..." so there must be something wrong with the way information is read from the database.

the odd thing is that it works with XP but not W2k3. There must be a specific setting that messes things up.

0 Kudos
yboychev
Hot Shot
Hot Shot

Hi all,

It would be great if you give some more details on the problem you are expiriencing. A lot of improvements are implemented regarding the OS Specs for the upcomming release but I would like to understand correctly your problem to verify it already addressed and if not to do so.

if I understand you correctly if you do:

1. New-VM -Name $newname -VMHost $vmhost -Datastore $Datastore -Template $Template -OSCustomizationSpec $Custscript --> something goes wrong (Error?)

2. New-Vm -Name $newname -VMHost $vmhost -Datastore $Datastore -Template $Template --> everything is O.K

\Yavor

0 Kudos
drexciya
Enthusiast
Enthusiast

That's the problem indeed, manually it works for both (using the Customization Specification), without a Customization Specification it works with both, with an XP Template with a Customization Specification it works, but not with Windows 2003 Server.

The error in VirtualCenter is a bit unclear, in the Virtualcenter logs (verbose mode, I'll try trivia as well) it looks like this:

-- FINISH task-internal-46190 -- host-51 -- VpxdInvtHostSyncHostLRO.Synchronize

hostVersion = 3.5.0, tools version = 7302

hostVersion = 3.5.0, tools version = 7302

Sysprep options: -quiet -mini -reseal -reboot

Successfully created file C:\WINNT\TEMP\imc70.tmp

Successfully created directory C:\WINNT\TEMP\imc-18

Successfully deleted file/directory C:\WINNT\TEMP\imc-18

Error occured while creating deploy package. Msg: LicenseFilePrintData.AutoMode

Successfully deleted file/directory C:\WINNT\TEMP\imc70.tmp

(W2k3Sjabloon_2) Unexpected exception (vim.fault.CustomizationFault) during clone. Aborting.

Starting journal rollback

0 Kudos
yboychev
Hot Shot
Hot Shot

Sounds like this problem is already addressed. Look for a solution in the upcomming releases.

\Yavor

0 Kudos