VMware Cloud Community
aaronmiller85
Enthusiast
Enthusiast
Jump to solution

Identify when sysprep is complete



Hello,

I have a script that currently builds a server to user input specs. When the server is deployed it goes through the sysprep process to input all the custimization, right now I'm using a wait timer to account for the sysprep time. (Other functions such as software installs etc occure after the sysprep process).


But i dont like using a wait timer as it can cause problems when sys prep takes longer than the wait timer, can anyone suggest a way after the server is built to account for the time to wait for sys prep to finish before moving on to other installs on the OS?

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Vitali did a great post on that, see Waiting for OS customization to complete


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

View solution in original post

Reply
0 Kudos
3 Replies
aaronmiller85
Enthusiast
Enthusiast
Jump to solution

New-VM -Name $displayname -Location $vclocation -ResourcePool $cluster -Datastore $datastore -Template $sourcetemplate -OSCustomizationspec Tempspec -HARestartPriority $haprio -DiskStorageFormat Thick

remove-OSCustomizationSpec Tempspec -confirm:$false | out-null

UpdateVMSettings | out-null

write-host "Starting server $displayname"

get-vm $displayname | start-vm

write-host "Waiting for sysprep to finish before proceeding further."

start-sleep -s 900

Updatetools | out-null

Above is an example of the script. It waits 900 seconds before installing tools on the OS. But I'd like to find a better way to identify when the OS is done sys prepping to reduce errors or potential errors.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Vitali did a great post on that, see Waiting for OS customization to complete


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

Reply
0 Kudos
aaronmiller85
Enthusiast
Enthusiast
Jump to solution

Great aritcle! Really appreciate it.

Reply
0 Kudos