This issue has been fixed in VMware Tools version 11.3.5, please upgrade VMware Tools version in template/source VM.
Workaround:
For vSphere 7.0 or later version and VMware Tools version cannot get upgraded to 11.3.5 in template/source VM, please follow below steps:
1. Enable customization script on template/source VM follow KB: https://knowledge.broadcom.com/external/article/313048.
2. Modify customization specification to include below customization script which helps to reboot VM after customization.
#!/bin/sh
if [ x$1 == x"postcustomization" ]; then
echo "rebooting" > /var/log/vmware-imc/script.log
systemctl reboot
fi
3. Apply above customization specification for customization task.
For vSphere 6.x or older version and VMware Tools version cannot get upgraded to 11.3.5 in template/source VM, please follow below steps to edit template/source VM:
1. Create file /etc/systemd/system/rebootvm.service with below content
[Unit]
Description=Reboot VM if uncaught signal 15
[Service]
Type=simple
ExecStart=timeout 180s /rebootvm.sh
[Install]
WantedBy=multi-user.target
2. Create a shell script at /rebootvm.sh with below content
#!/bin/bash
goscLogFile=/var/log/vmware-imc/toolsDeployPkg.log
while true; do
isRebootFailed=$(grep -E 'Failed to reboot' "$goscLogFile")
if [ ! -z "$isRebootFailed" ]; then
isUncaughtSignal15=$(grep -E 'uncaught signal 15' "$goscLogFile")
if [ ! -z "$isUncaughtSignal15" ]; then
systemctl disable rebootvm.service
rm -rf /etc/systemd/system/rebootvm.service
systemctl reboot
fi
fi
sleep 1
done
3. Delete file /var/log/vmware-imc/toolsDeployPkg.log if it exists
4. Enable rebootvm.service with below commands
$(sudo) chmod +x /rebootvm.sh
$(sudo) systemctl enable rebootvm.service
5. Power-off template/source VM and then it's ready for customization task.