-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provisionner "windows-restart" doesn't work #12663
Comments
Hi @Hassan1er thanks for reaching out. The error message at the end of your log Does your hardening script disable WinRM or prevent remote logins? Hardening scripts tend to disable all Packer communication to the instance so we recommend running hardening scripts as the last provisioner with the reboot being part of the hardening step if the reboot. The Powershell command doesn't have an I don't suspect this is a bug so I will label it as so. But I will keep the issue open for your comments and discussion. |
Hi @nywilken thanks for your answer. My hardening script doesn't disable WinRM or prevent remote logins. I'm alreay using it for 2016 and 2019 images, and it works perfectly. The problem only appears with 2022. The Packer Log doesn't give me utile informations about the error. |
After investigations, i found the issue with my problem. The hardening was effictively blocking WinRM. After changes, the pipeline was able to continue the process and the image is being created succesfully. Thanks. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Hello,
I'm using Packer throught Azure Pipelines to create Windows Server 2022 image. The VM is created with Hyper-V.
Here is my problem : After launching my hardening script on the VM, i try to use the provisionner "windows-restart", but it doesn't work.
The VM is not restarting, and the Azure Pipeline fails after the 10 minutes timeout. At the same time, i'm looking at the VM on Hyper-V to see what is going on, but nothing happens. The VM doesn't even shutdown to start again, it just stays on the desktop and nothing happens. I already tried to restart the machine manually, but the Azure Pipeline doesn't detect it, and still fails after 10 minutes. I tried to increase the restart timeout to 30m, but nothing changes. I tried to put a pause_before with 2m, but nothing changes. I also tried to restart the machine with a Powershell script, but the same thing happens, the VM doesn't restart and the pipeline fails. I don't know what to do more.
Thanks a lot for your help!
Here is the part of my script :
Here is the pipeline fail. My hardening script is launched at line 296. The provisionner "windows-restart" is launched at line 307. Between the lines 307 and 308, there is a wait of 10m corresping to the restart_timeout.
The text was updated successfully, but these errors were encountered: