Hi all,
I am calling a Guest OS customization spec in my PowerCLi script that I am using to automate the deploy of VM's. The script executes and 10 minutes later there is a machine on the domain with all our internal customization. This takes around 10 minutes to complete, which is great, but I noticed that the Guest OS customization takes around 4 minutes to start applying after the VM has been deployed from template. Has anyone else encountered this and is there a way to accelerate\te the initiation of the OS customization?
Running vSphere 5.5 Ent Plus.
ESXi 5.5.0 3116895
PowerCLi 5.5 Release 2
Thanks,
Ramsey.
Did you already check the logs for possible indications of this delay ?
There might be some clues in the logs mentioned in KB1026317.
The OSCustomization, provided your guest OS is a Windows OS, acts like sysprep.
Note that there have been reports of delayed sysprep execution as well.
The sysprep logs (Panther) could give some clues.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Luc. Unfortunately as part of our customization's we delete c:\temp from the deployed Windows VM once completed so I cant review the guest logs. I'll try deply another with few without the delete temp to see if anything odd gets logged there.
Ok now I can see some entries in the guestcust log. looks like it is taking 3 minutes to duplicate a .tmp to the same location just with a different name. then its wasting 120 seconds before rebooting because a reg value for 'CustomRescheduleRebootDelay' is not set.
[2016-05-24T16:10:37 INFO] GuestCustUtil invoked.
[2016-05-24T16:10:37 INFO] Params: customize -sealparam "/quiet /generalize /oobe /reboot" -nics 4000 -schedulenativeunobfusc
[2016-05-24T16:10:37 DEBUG] Registry value 'CustomRescheduleFlags' is not set. Returning default value: 0
[2016-05-24T16:10:37 INFO] Checking for Windows Sysprep Respecialize operation.
[2016-05-24T16:10:37 DEBUG] Sysprep process is currently running.
[2016-05-24T16:10:37 INFO] Windows Sysprep Respecialize operation was detected.
[2016-05-24T16:10:37 INFO] Copying files from C:\Windows\TEMP\vmwA4EB.tmp to C:\Windows\TEMP\vmwB575.tmp.
[2016-05-24T16:10:40 INFO] Rescheduling Guest OS Customization.
[2016-05-24T16:10:40 DEBUG] Executing command C:\Windows\system32\schtasks.exe /create /sc ONSTART /rl HIGHEST /np /z /v1 /ru SYSTEM /tr "C:\Windows\TEMP\vmwB575.tmp\guestcustutil.exe customize -sealparam \"/quiet /generalize /oobe /reboot\" -nics 4000 -schedulenativeunobfusc" /tn "VMware Guest OS Customization Task"
[2016-05-24T16:10:41 INFO] Waiting for Sysprep to exit.
[2016-05-24T16:10:42 INFO] Sysprep is no longer running.
[2016-05-24T16:10:42 DEBUG] Registry value 'CustomRescheduleRebootDelay' is not set. Returning default value: 120
[2016-05-24T16:10:42 INFO] Sleeping for 120 seconds...
[2016-05-24T16:12:42 INFO] Rebooting...
[2016-05-24T16:12:42 DEBUG] Successfully retreived process access token.
[2016-05-24T16:12:42 DEBUG] Got LUID for SHUTDOWN privilege.
[2016-05-24T16:12:42 DEBUG] Successfully added shutdown privilege.
[2016-05-24T16:12:42 INFO] GuestCustUtil exiting.
Ok, that explains already 5 minutes :smileygrin:
Not sure if the copy process is actually waiting, could be other processes using the disk.
Could also be that this folder is quite big.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
we found that this problem only seems to happen when you decrease the amount of cpu during deploy.
example: template is 2 cpu.
if you deploy a vm with 2 or more, no problem. if you deploy a VM with 1 cpu it will have those entries and reboot
so make sure you only deploy same or more as template or change template to 1 cpu (make sure to boot, reboot and shutdown before taking snapshot or converting to template after the change)
https://yetanothervrablog.wordpress.com/2017/07/19/make-sure-your-templates-only-have-1-cpu/
Thanks for sharing that, didn't realise this was happening.
Did you by any chance also test this with decreasing the memory?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference