Do not restart after updates
Hi,
Having an issue where the recent windows update KB5025230 is causing the instance to take a long time to reboot - Packer errors with the message retry count exhausted. Last err: http response error: 401 - invalid content type.
Is it possible to set the windows-update provisioner to not reboot after the updates are applied, and instead handle a restart with the windows-restart provisioner which has a restart_timeout parameter?
Thanks
No. Handling restarts is a typical requirement for applying windows updates. It has to be handled by this provisioner because packer does not have loops.
Did you try the restart_timeout parameter on this provisioner)?
Did you try the restart_timeout parameter on this provisioner)?
I did - didnt work.
It has to be handled by this provisioner because packer does not have loops.
You can use the flag IgnoreReboot with Install-WindowsUpdate - are you saying this provisioner will persist across reboots requested by an update that has been installed?
Did you try the restart_timeout parameter on this provisioner)?
I did - didnt work.
Oh that's a bummer :-(
It has to be handled by this provisioner because packer does not have loops.
You can use the flag
IgnoreRebootwith Install-WindowsUpdate - are you saying this provisioner will persist across reboots requested by an update that has been installed?
Not sure what you mean be persist, but, this provider will loop installing updates and rebooting until the updates are installed.
The problem with insisting on restarting on every single update that is done is wasting resources. Simply put, why boot 3 times when I can only do it once.
provisioner "windows-update" { search_criteria = "IsInstalled=0" filters = ["include:$_.Title -like 'Servicing Stack Update'"] update_limit = 25 update_reboot = false }
provisioner "windows-update" { search_criteria = "IsInstalled=0" filters = ["include:$_.Title -like 'Cumulative Update'"] update_limit = 25 update_reboot = false }
provisioner "windows-update" { search_criteria = "IsInstalled=0" filters = ["include:$_.Title -like 'Windows Malicious Software Removal Tool'"] update_limit = 25 update_reboot = false }
provisioner "windows-restart" { pause_before = "10s" restart_check_command = "powershell -command "& {Write-Output 'SSU and Cumulative Update reboot'}"" }
The problem with insisting on restarting on every single update that is done is wasting resources. Simply put, why boot 3 times when I can only do it once.
provisioner "windows-update" { search_criteria = "IsInstalled=0" filters = ["include:$_.Title -like 'Servicing Stack Update'"] update_limit = 25 update_reboot = false }
provisioner "windows-update" { search_criteria = "IsInstalled=0" filters = ["include:$_.Title -like 'Cumulative Update'"] update_limit = 25 update_reboot = false }
provisioner "windows-update" { search_criteria = "IsInstalled=0" filters = ["include:$_.Title -like 'Windows Malicious Software Removal Tool'"] update_limit = 25 update_reboot = false }
provisioner "windows-restart" { pause_before = "10s" restart_check_command = "powershell -command "& {Write-Output 'SSU and Cumulative Update reboot'}"" }
What resources are being wasted, and why invoke the provisioner 3 times instead of a single entry with multiple filters and let Windows and the provisioner handle the reboots as needed?
provisioner "windows-update" { pause_before = "60s" search_criteria = "IsInstalled=0" filters = [ "include:$.Title -like 'Servicing Stack Update'", "include:$.Title -like 'Cumulative Update'", "include:$.Title -like 'Windows Malicious Software Removal Tool'", "exclude:$.Title -like 'Preview'", "exclude:$_.InstallationBehavior.CanRequestUserInput" ] restart_timeout = "120m" }