This part I am not sure about - I want to make a template, so I have added a post-processor type vsphere. Is this the right thing to do? If I remove the section below, packer completes successfully and reports:
==> Builds finished. The artifacts of successful builds are:
--> vmware-iso: VM files in directory: /vmfs/volumes/NETAPP_01_DEV_SAS/output-windows10
In this scenario w/o the post-processor, the log reports all the artifacts on that volume, and I have confirmed they are there.
However in Vsphere I see an orphaned computer object.
"post-processors": [
{
"type": "vsphere",
"host": "{{ user `vsphere_host` }}",
"cluster": "{{ user `vsphere_cluster` }}",
"datacenter": "{{ user `vsphere_datacenter` }}",
"datastore": "{{ user `vsphere_datastore` }}",
"username": "{{ user `vsphere_username` }}",
"password": "{{ user `vsphere_password` }}",
"vm_network": "{{ user `vsphere_vm_network` }}",
"vm_folder": "/",
"vm_name": "windows10-template",
"insecure": "true",
"disk_mode": "thin"
}
]
2017/05/23 17:43:53 ui: ==> vmware-iso: Cleaning VMX prior to finishing up...
2017/05/23 17:43:53 ui: vmware-iso: Unmounting floppy from VMX...
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 Deleting key: floppy0.filename
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 Deleting key: floppy0.filetype
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 Deleting key: floppy0.present
2017/05/23 17:43:53 ui: vmware-iso: Disabling VNC server...
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 Writing VMX to: C:\Users\DAO~1.RIC\AppData\Local\Temp\packer-vmx760098881\windows10.vmx
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 opening new ssh session
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 Starting remote scp process: scp -vt /vmfs/volumes/NETAPP_01_DEV_SAS/output-windows10
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 Started SCP session, beginning transfers...
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 Copying input data into temporary file so we can read the length
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 [DEBUG] scp: Uploading windows10.vmx: perms=C0644 size=3068
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 SCP session complete, closing stdin pipe.
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 Waiting for SSH session to complete.
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 scp stderr (length 31): Sink: C0644 3068 windows10.vmx
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 opening new ssh session
2017/05/23 17:43:53 packer.exe: 2017/05/23 17:43:53 starting remote command: vim-cmd vmsvc/reload 290
2017/05/23 17:43:54 packer.exe: 2017/05/23 17:43:54 opening new ssh session
2017/05/23 17:43:54 packer.exe: 2017/05/23 17:43:54 starting remote command: vim-cmd vmsvc/power.getstate 290
2017/05/23 17:43:55 ui: ==> vmware-iso: Unregistering virtual machine...
2017/05/23 17:43:55 packer.exe: 2017/05/23 17:43:55 opening new ssh session
2017/05/23 17:43:55 packer.exe: 2017/05/23 17:43:55 starting remote command: vim-cmd vmsvc/unregister 290
2017/05/23 17:43:56 packer.exe: 2017/05/23 17:43:56 Deleting floppy disk: C:\Users\DAO~1.RIC\AppData\Local\Temp\packer242371319
2017/05/23 17:43:56 packer.exe: 2017/05/23 17:43:56 opening new ssh session
2017/05/23 17:43:56 packer.exe: 2017/05/23 17:43:56 starting remote command: ls -1p /vmfs/volumes/NETAPP_01_DEV_SAS/output-windows10
2017/05/23 17:43:56 ui: ==> vmware-iso: Running post-processor: vsphere
2017/05/23 17:43:56 ui: vmware-iso (vsphere): Uploading /vmfs/volumes/NETAPP_01_DEV_SAS/output-windows10/windows10.vmx to vSphere
2017/05/23 17:43:56 packer.exe: 2017/05/23 17:43:56 Starting ovftool with parameters: --acceptAllEulas --name=windows10-template --datastore=NETAPP_01_DEV_SAS --noSSLVerify=true --diskMode=thin --network=VM Network 10.5.12.x /vmfs/volumes/NETAPP_01_DEV_SAS/output-windows10/windows10.vmx vi://root:<password>@tp-nj-dev-esx-01.3rdpoint.corp/TP DataCenter/host/tp-nj-dev-esx-01.3rdpoint.corp
2017/05/23 17:43:56 Deleting original artifact for build 'vmware-iso'
2017/05/23 17:43:56 packer.exe: 2017/05/23 17:43:56 opening new ssh session
2017/05/23 17:43:56 packer.exe: 2017/05/23 17:43:56 starting remote command: rm -rf /vmfs/volumes/NETAPP_01_DEV_SAS/output-windows10
2017/05/23 17:43:56 ui error: Build 'vmware-iso' errored: 1 error(s) occurred:
* Post-processor failed: Failed: exit status 3221225781
2017/05/23 17:43:56 Builds completed. Waiting on interrupt barrier...
2017/05/23 17:43:56 machine readable: error-count []string{"1"}
2017/05/23 17:43:56 ui error:
==> Some builds didn't complete successfully and had errors:
2017/05/23 17:43:56 machine readable: vmware-iso,error []string{"1 error(s) occurred:\n\n* Post-processor failed: Failed: exit status 3221225781\n"}
2017/05/23 17:43:56 ui error: --> vmware-iso: 1 error(s) occurred:
* Post-processor failed: Failed: exit status 3221225781
2017/05/23 17:43:56 ui:
==> Builds finished but no artifacts were created.
2017/05/23 17:43:56 waiting for all plugin processes to complete...
2017/05/23 17:43:56 C:\packer\packer.exe: plugin process exited
2017/05/23 17:43:56 C:\packer\packer.exe: plugin process exited
2017/05/23 17:43:56 C:\packer\packer.exe: plugin process exited