{"action":"created","issue":{"url":"https://api.github.com/repos/mitchellh/packer/issues/2613","labels_url":"https://api.github.com/repos/mitchellh/packer/issues/2613/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/packer/issues/2613/comments","events_url":"https://api.github.com/repos/mitchellh/packer/issues/2613/events","html_url":"https://github.com/mitchellh/packer/issues/2613","id":101482993,"number":2613,"title":"windows-restart failing to restart","user":{"login":"highlyunavailable","id":6266125,"avatar_url":"https://avatars.githubusercontent.com/u/6266125?v=3","gravatar_id":"","url":"https://api.github.com/users/highlyunavailable","html_url":"https://github.com/highlyunavailable","followers_url":"https://api.github.com/users/highlyunavailable/followers","following_url":"https://api.github.com/users/highlyunavailable/following{/other_user}","gists_url":"https://api.github.com/users/highlyunavailable/gists{/gist_id}","starred_url":"https://api.github.com/users/highlyunavailable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highlyunavailable/subscriptions","organizations_url":"https://api.github.com/users/highlyunavailable/orgs","repos_url":"https://api.github.com/users/highlyunavailable/repos","events_url":"https://api.github.com/users/highlyunavailable/events{/privacy}","received_events_url":"https://api.github.com/users/highlyunavailable/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitchellh/packer/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/mitchellh/packer/labels/provisioner/powershell","name":"provisioner/powershell","color":"c7def8"},{"url":"https://api.github.com/repos/mitchellh/packer/labels/windows-image","name":"windows-image","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-17T18:36:19Z","updated_at":"2015-08-18T00:01:35Z","closed_at":"2015-08-18T00:01:35Z","body":"I've got a packer config that looks like this:\r\n```\r\n    {\r\n      \"type\": \"powershell\",\r\n      \"scripts\": [\r\n        \"{{template_dir}}/scripts/install-netfx3.ps1\",\r\n        \"{{template_dir}}/scripts/win-updates.ps1\"\r\n      ]\r\n    },\r\n    {\r\n      \"type\": \"windows-restart\"\r\n    },\r\n    {\r\n      \"type\": \"powershell\",\r\n      \"scripts\": [\r\n        \"{{template_dir}}/scripts/win-updates.ps1\",\r\n        \"{{template_dir}}/scripts/set-bundleconfig.ps1\",\r\n        \"{{template_dir}}/scripts/set-ec2config.ps1\"\r\n      ]\r\n    },\r\n    {\r\n      \"type\": \"windows-restart\"\r\n    }\r\n```\r\n\r\nI'm using the windows-restart action twice because windows updates don't always apply all of them on the first pass, so I apply all applicable updates, restart, apply again to get more updates, restart, create an AMI.\r\n\r\nI'm getting the following non-terminating error on the SECOND windows-restart block:\r\n```\r\n==> amazon-ebs: Restarting Machine\r\n    amazon-ebs: Restart-Computer : Failed to restart the computer WIN-1VVN227ATGQ with the\r\n    amazon-ebs: following error message: A system shutdown is in progress.\r\n    amazon-ebs: At line:1 char:4\r\n    amazon-ebs: + & {Restart-Computer -force }\r\n    amazon-ebs: +    ~~~~~~~~~~~~~~~~~~~~~~~\r\n    amazon-ebs: + CategoryInfo          : OperationStopped: (WIN-1VVN227ATGQ:String) [Rest\r\n    amazon-ebs: art-Computer], InvalidOperationException\r\n    amazon-ebs: + FullyQualifiedErrorId : RestartcomputerFailed,Microsoft.PowerShell.Comma\r\n    amazon-ebs: nds.RestartComputerCommand\r\n    amazon-ebs:\r\n==> amazon-ebs: Waiting for machine to restart...\r\n    amazon-ebs: WIN-1VVN227ATGQ restarted.\r\n==> amazon-ebs: Machine successfully restarted, moving on\r\n```\r\n\r\nNone of the other scripts I'm using here would restart the machine."},"comment":{"url":"https://api.github.com/repos/mitchellh/packer/issues/comments/131998829","html_url":"https://github.com/mitchellh/packer/issues/2613#issuecomment-131998829","issue_url":"https://api.github.com/repos/mitchellh/packer/issues/2613","id":131998829,"user":{"login":"highlyunavailable","id":6266125,"avatar_url":"https://avatars.githubusercontent.com/u/6266125?v=3","gravatar_id":"","url":"https://api.github.com/users/highlyunavailable","html_url":"https://github.com/highlyunavailable","followers_url":"https://api.github.com/users/highlyunavailable/followers","following_url":"https://api.github.com/users/highlyunavailable/following{/other_user}","gists_url":"https://api.github.com/users/highlyunavailable/gists{/gist_id}","starred_url":"https://api.github.com/users/highlyunavailable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highlyunavailable/subscriptions","organizations_url":"https://api.github.com/users/highlyunavailable/orgs","repos_url":"https://api.github.com/users/highlyunavailable/repos","events_url":"https://api.github.com/users/highlyunavailable/events{/privacy}","received_events_url":"https://api.github.com/users/highlyunavailable/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T00:01:35Z","updated_at":"2015-08-18T00:01:35Z","body":"Ha, yes, it was actually a sleep issue. Ther"}}