{"action":"created","issue":{"url":"https://api.github.com/repos/mitchellh/packer/issues/2579","repository_url":"https://api.github.com/repos/mitchellh/packer","labels_url":"https://api.github.com/repos/mitchellh/packer/issues/2579/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/packer/issues/2579/comments","events_url":"https://api.github.com/repos/mitchellh/packer/issues/2579/events","html_url":"https://github.com/mitchellh/packer/issues/2579","id":100199925,"number":2579,"title":"packer deletes VM from Esxi inventory after successful build!","user":{"login":"ghost","id":10137,"avatar_url":"https://avatars.githubusercontent.com/u/10137?v=3","gravatar_id":"","url":"https://api.github.com/users/ghost","html_url":"https://github.com/ghost","followers_url":"https://api.github.com/users/ghost/followers","following_url":"https://api.github.com/users/ghost/following{/other_user}","gists_url":"https://api.github.com/users/ghost/gists{/gist_id}","starred_url":"https://api.github.com/users/ghost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghost/subscriptions","organizations_url":"https://api.github.com/users/ghost/orgs","repos_url":"https://api.github.com/users/ghost/repos","events_url":"https://api.github.com/users/ghost/events{/privacy}","received_events_url":"https://api.github.com/users/ghost/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/builder/vmware-esxi","name":"builder/vmware-esxi","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-08-11T00:51:34Z","updated_at":"2016-03-18T17:30:23Z","closed_at":null,"body":"Hi,\r\nPacker successfully build the Centos7 image but after that it removes the vm from inventory. However, it keeps the VM in data store and I can manually add it to inventory from the data store!\r\nNot sure, how to fix that?\r\n\r\nPacker v0.7.5\r\n\r\nMy config----\r\n\r\n```\r\n{\r\n  \"builders\": [\r\n    {\r\n      \"type\": \"vmware-iso\",\r\n      \"vm_name\": \"centos-rhel-7\",\r\n      \"iso_url\": \"/home/files/CentOS-7-x86_64-Minimal-1503-01.iso\",\r\n      \"iso_checksum\": \"d07ab3e615c66a8b2e9a50f4852e6a77\",\r\n      \"iso_checksum_type\": \"md5\",\r\n      \"disk_size\": \"10240\",\r\n      \"disk_type_id\": \"thin\",\r\n      \"http_directory\": \"~/packertemplatebuilding\",\r\n      \"remote_host\": \"192.168.111.111\",\r\n      \"remote_datastore\": \"SSD_60\",\r\n      \"remote_username\": \"root\",\r\n      \"remote_password\": \"abc@123\",\r\n      \"remote_type\": \"esx5\",\r\n      \"ssh_username\": \"root\",\r\n      \"guest_os_type\": \"rhel6-64\",\r\n      \"ssh_password\": \"abc@123\",\r\n      \"ssh_port\": 22,\r\n      \"ssh_wait_timeout\": \"20m\",\r\n      \"shutdown_command\": \"shutdown -h now\",\r\n      \"headless\": \"false\",\r\n      \"boot_command\": [\r\n        \"<tab> text ks=http://192.168.111.8/files/ksv3.cfg<enter><wait>\"\r\n      ],\r\n      \"boot_wait\": \"5s\",\r\n      \"vmx_data\": {\r\n        \"ethernet0.networkName\": \"VM Network\",\r\n        \"config.version\": 8,\r\n        \"virtualHW.version\": 8,\r\n        \"ethernet0.present\": \"true\",\r\n        \"ethernet0.virtualDev\": \"e1000\", \r\n        \"ethernet0.startConnected\": \"true\",\r\n        \"ethernet0.addressType\": \"generated\",\r\n        \"memsize\": \"2048\",\r\n        \"numvcpus\": \"2\",\r\n        \"cpuid.coresPerSocket\": \"1\",\r\n        \"ide0:0.fileName\": \"disk.vmdk\",\r\n        \"ide0:0.present\": \"TRUE\",\r\n        \"ide0:0.redo\": \"\",\r\n        \"scsi0:0.present\": \"FALSE\",\r\n        \"RemoteDisplay.vnc.enabled\": \"TRUE\",\r\n        \"RemoteDisplay.vnc.port\":  \"5900\"\r\n\r\n      }\r\n    }\r\n  ]\r\n}\r\n\r\n```\r\n\r\nPacker log------\r\n\r\n\r\n ```\r\n\r\n2015/08/10 20:35:07 packer-builder-vmware-iso: 2015/08/10 20:35:07 TCP connection to SSH ip/port failed: dial tcp 192.168.111.153:22: connection refused\r\n2015/08/10 20:35:27 packer-builder-vmware-iso: 2015/08/10 20:35:27 TCP connection to SSH ip/port failed: dial tcp 192.168.111.153:22: i/o timeout\r\n2015/08/10 20:35:32 packer-builder-vmware-iso: 2015/08/10 20:35:32 Attempting SSH connection...\r\n2015/08/10 20:35:32 packer-builder-vmware-iso: 2015/08/10 20:35:32 reconnecting to TCP connection for SSH\r\n2015/08/10 20:35:32 packer-builder-vmware-iso: 2015/08/10 20:35:32 handshaking with SSH\r\n2015/08/10 20:35:32 ui: ==> vmware-iso: Connected to SSH!\r\n==> vmware-iso: Connected to SSH!\r\n2015/08/10 20:35:32 packer-builder-vmware-iso: 2015/08/10 20:35:32 opening new ssh session\r\n2015/08/10 20:35:32 packer-builder-vmware-iso: 2015/08/10 20:35:32 starting remote command: vim-cmd vmsvc/tools.install 25\r\n2015/08/10 20:35:32 packer-builder-vmware-iso: 2015/08/10 20:35:32 remote command exited with '0': vim-cmd vmsvc/tools.install 25\r\n2015/08/10 20:35:32 packer-builder-vmware-iso: 2015/08/10 20:35:32 Running the provision hook\r\n2015/08/10 20:35:32 ui: ==> vmware-iso: Forcibly halting virtual machine...\r\n==> vmware-iso: Forcibly halting virtual machine...\r\n2015/08/10 20:35:32 packer-builder-vmware-iso: 2015/08/10 20:35:32 opening new ssh session\r\n2015/08/10 20:35:32 packer-builder-vmware-iso: 2015/08/10 20:35:32 starting remote command: vim-cmd vmsvc/power.off 25\r\n2015/08/10 20:35:33 packer-builder-vmware-iso: 2015/08/10 20:35:33 remote command exited with '0': vim-cmd vmsvc/power.off 25\r\n2015/08/10 20:35:33 ui:     vmware-iso: Waiting for VMware to clean up after itself...\r\n2015/08/10 20:35:33 packer-builder-vmware-iso: 2015/08/10 20:35:33 opening new ssh session\r\n2015/08/10 20:35:33 packer-builder-vmware-iso: 2015/08/10 20:35:33 starting remote command: ls -1p /vmfs/volumes/SSD_60/output-vmware-iso\r\n    vmware-iso: Waiting for VMware to clean up after itself...\r\n2015/08/10 20:35:33 packer-builder-vmware-iso: 2015/08/10 20:35:33 remote command exited with '0': ls -1p /vmfs/volumes/SSD_60/output-vmware-iso\r\n2015/08/10 20:35:33 packer-builder-vmware-iso: 2015/08/10 20:35:33 No more lock files found. VMware is clean.\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 VM shut down.\r\n2015/08/10 20:35:38 ui: ==> vmware-iso: Deleting unnecessary VMware files...\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 opening new ssh session\r\n==> vmware-iso: Deleting unnecessary VMware files...\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 starting remote command: ls -1p /vmfs/volumes/SSD_60/output-vmware-iso\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 remote command exited with '0': ls -1p /vmfs/volumes/SSD_60/output-vmware-iso\r\n2015/08/10 20:35:38 ui:     vmware-iso: Deleting: /vmfs/volumes/SSD_60/output-vmware-iso/vmware.log\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 opening new ssh session\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 starting remote command: rm /vmfs/volumes/SSD_60/output-vmware-iso/vmware.log\r\n    vmware-iso: Deleting: /vmfs/volumes/SSD_60/output-vmware-iso/vmware.log\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 remote command exited with '0': rm /vmfs/volumes/SSD_60/output-vmware-iso/vmware.log\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 Writing VMX to: /tmp/packer-vmx905476820/centos-rhel-7.vmx\r\n2015/08/10 20:35:38 ui: ==> vmware-iso: Cleaning VMX prior to finishing up...\r\n==> vmware-iso: Cleaning VMX prior to finishing up...\r\n2015/08/10 20:35:38 ui:     vmware-iso: Unmounting floppy from VMX...\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 Deleting key: floppy0.present\r\n    vmware-iso: Unmounting floppy from VMX...\r\n2015/08/10 20:35:38 ui:     vmware-iso: Detaching ISO from CD-ROM device...\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 Writing VMX to: /tmp/packer-vmx905476820/centos-rhel-7.vmx\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 opening new ssh session\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 Starting remote scp process:  scp -vt /vmfs/volumes/SSD_60/output-vmware-iso\r\n    vmware-iso: Detaching ISO from CD-ROM device...\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 Started SCP session, beginning transfers...\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 Copying input data into temporary file so we can read the length\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 [DEBUG] Uploading centos-rhel-7.vmx: perms=C0644 size=2414\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 SCP session complete, closing stdin pipe.\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 Waiting for SSH session to complete.\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 scp stderr (length 35): Sink: C0644 2414 centos-rhel-7.vmx\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 opening new ssh session\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 starting remote command: vim-cmd vmsvc/reload 25\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 remote command exited with '0': vim-cmd vmsvc/reload 25\r\n2015/08/10 20:35:38 ui: ==> vmware-iso: Compacting the disk image\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 opening new ssh session\r\n2015/08/10 20:35:38 packer-builder-vmware-iso: 2015/08/10 20:35:38 starting remote command: vim-cmd vmsvc/power.getstate 25\r\n==> vmware-iso: Compacting the disk image\r\n2015/08/10 20:35:39 packer-builder-vmware-iso: 2015/08/10 20:35:39 remote command exited with '0': vim-cmd vmsvc/power.getstate 25\r\n2015/08/10 20:35:39 ui: ==> vmware-iso: Unregistering virtual machine...\r\n2015/08/10 20:35:39 packer-builder-vmware-iso: 2015/08/10 20:35:39 opening new ssh session\r\n2015/08/10 20:35:39 packer-builder-vmware-iso: 2015/08/10 20:35:39 starting remote command: vim-cmd vmsvc/unregister 25\r\n==> vmware-iso: Unregistering virtual machine...\r\n2015/08/10 20:35:39 packer-builder-vmware-iso: 2015/08/10 20:35:39 remote command exited with '0': vim-cmd vmsvc/unregister 25\r\n2015/08/10 20:35:39 packer-builder-vmware-iso: 2015/08/10 20:35:39 opening new ssh session\r\n2015/08/10 20:35:39 packer-builder-vmware-iso: 2015/08/10 20:35:39 starting remote command: ls -1p /vmfs/volumes/SSD_60/output-vmware-iso\r\n2015/08/10 20:35:39 packer-builder-vmware-iso: 2015/08/10 20:35:39 remote command exited with '0': ls -1p /vmfs/volumes/SSD_60/output-vmware-iso\r\n2015/08/10 20:35:39 ui: Build 'vmware-iso' finished.\r\n2015/08/10 20:35:39 Builds completed. Waiting on interrupt barrier...\r\n2015/08/10 20:35:39 ui: \r\n==> Builds finished. The artifacts of successful builds are:\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact-count []string{\"1\"}\r\nBuild 'vmware-iso' finished.\r\n\r\n==> Builds finished. The artifacts of successful builds are:\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"builder-id\", \"mitchellh.vmware-esx\"}\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"id\", \"VM\"}\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"string\", \"VM files in directory: /vmfs/volumes/SSD_60/output-vmware-iso\"}\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"files-count\", \"6\"}\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"file\", \"0\", \"/vmfs/volumes/SSD_60/output-vmware-iso/centos-rhel-7.nvram\"}\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"file\", \"1\", \"/vmfs/volumes/SSD_60/output-vmware-iso/centos-rhel-7.vmsd\"}\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"file\", \"2\", \"/vmfs/volumes/SSD_60/output-vmware-iso/centos-rhel-7.vmx\"}\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"file\", \"3\", \"/vmfs/volumes/SSD_60/output-vmware-iso/centos-rhel-7.vmxf\"}\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"file\", \"4\", \"/vmfs/volumes/SSD_60/output-vmware-iso/disk-flat.vmdk\"}\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"file\", \"5\", \"/vmfs/volumes/SSD_60/output-vmware-iso/disk.vmdk\"}\r\n2015/08/10 20:35:39 machine readable: vmware-iso,artifact []string{\"0\", \"end\"}\r\n2015/08/10 20:35:39 ui: --> vmware-iso: VM files in directory: /vmfs/volumes/SSD_60/output-vmware-iso\r\n2015/08/10 20:35:39 waiting for all plugin processes to complete...\r\n--> vmware-iso: VM files in directory: /vmfs/volumes/SSD_60/output-vmware-iso\r\n2015/08/10 20:35:39 /root/go/bin/packer-builder-vmware-iso: plugin process exited\r\n```"},"comment":{"url":"https://api.github.com/repos/mitchellh/packer/issues/comments/198463425","html_url":"https://github.com/mitchellh/packer/issues/2579#issuecomment-198463425","issue_url":"https://api.github.com/repos/mitchellh/packer/issues/2579","id":198463425,"user":{"login":"rhass","id":1200379,"avatar_url":"https://avatars.githubusercontent.com/u/1200379?v=3","gravatar_id":"","url":"https://api.github.com/users/rhass","html_url":"https://github.com/rhass","followers_url":"https://api.github.com/users/rhass/followers","following_url":"https://api.github.com/users/rhass/following{/other_user}","gists_url":"https://api.github.com/users/rhass/gists{/gist_id}","starred_url":"https://api.github.com/users/rhass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhass/subscriptions","organizations_url":"https://api.github.com/users/rhass/orgs","repos_url":"https://api.github.com/users/rhass/repos","events_url":"https://api.github.com/users/rhass/events{/privacy}","received_events_url":"https://api.github.com/users/rhass/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T17:30:23Z","updated_at":"2016-03-18T17:30:23Z","body":"The PR was merged into master -- we can probably resolve/close this issue."}}