I created a powershell script, but when I add "exit 1003" it won't restart the VM automatically. I'm using windows server 2019 with all the latest updates. I run cloudbase-init with service: "NoCloudConfigDriveService".
The problem seems like this: https://ask.cloudbase.it/question/3136/where-do-i-specify-file-execution-return-code/ but I didn't understand the solution.
I configured cloudbase-init with "allow_reboot=true" in both cloudbase-init.conf and cloudbase-init-unattend.conf. I added "cloudbase.plugins.common.locascripts.LocalScriptsPlugin" as plugin in cloudbase-init.conf. Then I executed Sysprep.exe with "/generalize /oobe /shutdown /unattend:Unattend.xml".
When I start the windows server 2019 VM, Cloudbase-init creates users, network config and runs Localscript as expected, but It won't restart ad "exit 1003"
Which are the required config parameters to enable automatic reboot returning 1003 as exit code from a local script?
Thank you.