From 974d9974fe1d6aaa0dc99f3abaec2159b2864f45 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 7 Feb 2018 11:34:18 -0800 Subject: [PATCH] add workaround for azure bug. --- provisioner/windows-restart/provisioner.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/provisioner/windows-restart/provisioner.go b/provisioner/windows-restart/provisioner.go index 0568516aa..ecf15e6a1 100644 --- a/provisioner/windows-restart/provisioner.go +++ b/provisioner/windows-restart/provisioner.go @@ -114,6 +114,12 @@ var waitForRestart = func(p *Provisioner, comm packer.Communicator) error { var cmd *packer.RemoteCmd trycommand := TryCheckReboot abortcommand := AbortReboot + + // This sleep works around an azure/winrm bug. For more info see + // https://github.com/hashicorp/packer/issues/5257; we can remove the + // sleep when the underlying bug has been resolved. + time.Sleep(1 * time.Second) + // Stolen from Vagrant reboot checker for { log.Printf("Check if machine is rebooting...")