{"action":"created","issue":{"url":"https://api.github.com/repos/mitchellh/packer/issues/4191","repository_url":"https://api.github.com/repos/mitchellh/packer","labels_url":"https://api.github.com/repos/mitchellh/packer/issues/4191/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/packer/issues/4191/comments","events_url":"https://api.github.com/repos/mitchellh/packer/issues/4191/events","html_url":"https://github.com/mitchellh/packer/issues/4191","id":190865292,"number":4191,"title":"Failed to send shutdown command with windows 2012 on vmware-iso (0.12)","user":{"login":"moodwrench","id":10999331,"avatar_url":"https://avatars.githubusercontent.com/u/10999331?v=3","gravatar_id":"","url":"https://api.github.com/users/moodwrench","html_url":"https://github.com/moodwrench","followers_url":"https://api.github.com/users/moodwrench/followers","following_url":"https://api.github.com/users/moodwrench/following{/other_user}","gists_url":"https://api.github.com/users/moodwrench/gists{/gist_id}","starred_url":"https://api.github.com/users/moodwrench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moodwrench/subscriptions","organizations_url":"https://api.github.com/users/moodwrench/orgs","repos_url":"https://api.github.com/users/moodwrench/repos","events_url":"https://api.github.com/users/moodwrench/events{/privacy}","received_events_url":"https://api.github.com/users/moodwrench/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-21T23:25:00Z","updated_at":"2016-12-05T22:14:51Z","closed_at":null,"body":"Version: Packer v0.11.0 and v0.12.0\r\n\r\n# uname -a\r\nLinux pack01d-ops-08.portal.webmd.com 2.6.32-504.30.3.el6.x86_64 #1 SMP Wed Jul 15 10:13:09 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\nwe've started seeing an issue that only seems to affect windows 2012 hosts using the vmware-iso builder on a remote ESXi machine.  I reported the issue on https://github.com/mitchellh/packer/issues/4171 but was told that this issue was fixed in 0.12.0.   Weve retested and the issue remains in 0.12.0\r\n\r\n\"type\": \"vmware-iso\"\r\n\"remote_type\": \"esx5\"\r\n\"shutdown_command\": \"shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"\",\r\n\r\nIt seems that the build completes successfully with no communications issues or winrm issues, then times out connecting for the shutdown.\r\n\r\ndebug logs:\r\n\r\n2016/11/15 14:19:18 ui: ==> vmware-iso: Gracefully halting virtual machine...\r\n==> vmware-iso: Gracefully halting virtual machine...\r\n2016/11/15 14:19:18 packer: 2016/11/15 14:19:18 Executing shutdown command: shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"\r\n2016/11/15 14:20:21 ui error: ==> vmware-iso: Failed to send shutdown command: unknown error Post http://xxx.xxx.xxx.xxx:5985/wsman: dial tcp xxx.xxx.xxx.xxx:5985: getsockopt: connection timed out\r\n2016/11/15 14:20:21 packer: 2016/11/15 14:20:21 opening new ssh session\r\n==> vmware-iso: Failed to send shutdown command: unknown error Post http://xxx.xxx.xxx.xxx:5985/wsman: dial tcp xxx.xxx.xxx.xxx:5985: getsockopt: connection timed out\r\n2016/11/15 14:20:21 packer: 2016/11/15 14:20:21 starting remote command: vim-cmd vmsvc/power.getstate 36\r\n2016/11/15 14:20:22 ui: ==> vmware-iso: Destroying virtual machine...\r\n==> vmware-iso: Destroying virtual machine...\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 opening new ssh session\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 starting remote command: vim-cmd vmsvc/destroy 36\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 opening new ssh session\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 starting remote command: test ! -e /vmfs/volumes/iso_datastore/windows_2012_r2-v1479232908\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 Remote command exited with '1': test ! -e /vmfs/volumes/iso_datastore/windows_2012_r2-v1479232908\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 opening new ssh session\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 starting remote command: test ! -e /vmfs/volumes/iso_datastore/windows_2012_r2-v1479232908\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 Remote command exited with '1': test ! -e /vmfs/volumes/iso_datastore/windows_2012_r2-v1479232908\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 opening new ssh session\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 starting remote command: test ! -e /vmfs/volumes/iso_datastore/windows_2012_r2-v1479232908\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 Deleting floppy disk: /tmp/packer222785091\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 opening new ssh session\r\n2016/11/15 14:20:22 packer: 2016/11/15 14:20:22 starting remote command: test -e /vmfs/volumes/iso_datastore/windows_2012_r2-v1479232908\r\n2016/11/15 14:20:23 packer: 2016/11/15 14:20:23 Remote command exited with '1': test -e /vmfs/volumes/iso_datastore/windows_2012_r2-v1479232908\r\nBuild 'vmware-iso' errored: Failed to send shutdown command: unknown error Post http://xxx.xxx.xxx.xxx:5985/wsman: dial tcp xxx.xxx.xxx.xxx:5985: getsockopt: connection timed out\r\n\r\n==> Some builds didn't complete successfully and had errors:\r\n2016/11/15 14:20:23 ui error: Build 'vmware-iso' errored: Failed to send shutdown command: unknown error Post http://xxx.xxx.xxx.xxx:5985/wsman: dial tcp xxx.xxx.xxx.xxx:5985: getsockopt: connection timed out\r\n2016/11/15 14:20:23 Builds completed. Waiting on interrupt barrier...\r\n2016/11/15 14:20:23 machine readable: error-count []string{\"1\"}\r\n2016/11/15 14:20:23 ui error: \r\n==> Some builds didn't complete successfully and had errors:\r\n--> vmware-iso: Failed to send shutdown command: unknown error Post http://xxx.xxx.xxx.xxx:5985/wsman: dial tcp xxx.xxx.xxx.xxx:5985: getsockopt: connection timed out\r\n\r\n2016/11/15 14:20:23 machine readable: vmware-iso,error []string{\"Failed to send shutdown command: unknown error Post http://xxx.xxx.xxx.xxx:5985/wsman: dial tcp xxx.xxx.xxx.xxx:5985: getsockopt: connection timed out\"}\r\n2016/11/15 14:20:23 ui error: --> vmware-iso: Failed to send shutdown command: unknown error Post http://xxx.xxx.xxx.xxx:5985/wsman: dial tcp xxx.xxx.xxx.xxx:5985: getsockopt: connection timed out\r\n2016/11/15 14:20:23 ui: \r\n==> Builds finished but no artifacts were created."},"comment":{"url":"https://api.github.com/repos/mitchellh/packer/issues/comments/264995154","html_url":"https://github.com/mitchellh/packer/issues/4191#issuecomment-264995154","issue_url":"https://api.github.com/repos/mitchellh/packer/issues/4191","id":264995154,"user":{"login":"trodemaster","id":5666516,"avatar_url":"https://avatars.githubusercontent.com/u/5666516?v=3","gravatar_id":"","url":"https://api.github.com/users/trodemaster","html_url":"https://github.com/trodemaster","followers_url":"https://api.github.com/users/trodemaster/followers","following_url":"https://api.github.com/users/trodemaster/following{/other_user}","gists_url":"https://api.github.com/users/trodemaster/gists{/gist_id}","starred_url":"https://api.github.com/users/trodemaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trodemaster/subscriptions","organizations_url":"https://api.github.com/users/trodemaster/orgs","repos_url":"https://api.github.com/users/trodemaster/repos","events_url":"https://api.github.com/users/trodemaster/events{/privacy}","received_events_url":"https://api.github.com/users/trodemaster/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T22:14:51Z","updated_at":"2016-12-05T22:14:51Z","body":"Just a quick comment.. \r\n\r\nThe quoting on this doesn't look correct to me. \r\n\"shutdown_command\": \"shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"\"\r\n\r\nYou might try this..\r\n\"shutdown_command\": \"shutdown /s /t 10 /f /d p:4:1 /c \\\"Packer Shutdown\\\"\"\r\n\r\nI'm using the following command successfully on VMware Fusion/Windows Server 2012r2 builds. \r\n\"shutdown_command\": \"shutdown /s /t 5 /f /d p:4:1\"\r\n\r\n-Blake\r\n"}}
{"actor":{"display_login":"trodemaster"}}