hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.03k stars 3.32k forks source link

abort error on vmware-iso upload in packer 0.12 #4179

Closed moodwrench closed 4 years ago

moodwrench commented 7 years ago

packer 0.12.0

After updating to packer 0.12.0 when trying to upload to vcenter using the vsphere postprocessor I now get the following error:

2016/11/17 13:33:54 ui: ==> vmware-iso: Running post-processor: vsphere
2016/11/17 13:33:54 ui:     vmware-iso (vsphere): Uploading centos68-v1479406182/centos68-v1479406182/centos68-v1479406182.ovf to vSphere
    vmware-iso (vsphere): Uploading centos68-v1479406182/centos68-v1479406182/centos68-v1479406182.ovf to vSphere
2016/11/17 13:33:54 packer: 2016/11/17 13:33:54 Starting ovftool with parameters: --acceptAllEulas --name=centos68-v1479406182 --datastore=NFS-Lab-Templates --noSSLVerify=true --diskMode=thin --vmFolder=/PPP --network=MGMT1 --overwrite --extraConfig:disk.enableUUID=true centos68-v1479406182/centos68-v1479406182/centos68-v1479406182.ovf vi://user:xxxxxx@vc01/Lab/host/LAB_A
==> vmware-iso: Running post-processor: vsphere
2016/11/17 13:59:25 ui: ==> vmware-iso: Running post-processor: vsphere
2016/11/17 13:59:25 ui:     vmware-iso (vsphere): Uploading centos68-v1479406182/centos68-v1479406182/centos68-v1479406182.ovf to vSphere
    vmware-iso (vsphere): Uploading centos68-v1479406182/centos68-v1479406182/centos68-v1479406182.ovf to vSphere
2016/11/17 13:59:25 packer: 2016/11/17 13:59:25 Starting ovftool with parameters: --acceptAllEulas --name=centos68-v1479406182 --datastore=NFS-Lab-Templates --noSSLVerify=true --diskMode=thin --vmFolder=/PPP --network=MGMT1 --overwrite --extraConfig:disk.enableUUID=true centos68-v1479406182/centos68-v1479406182/centos68-v1479406182.ovf vi://user:xxxxx@vc01/Lab/host/LAB_A
2016/11/17 13:59:54 Deleting original artifact for build 'vmware-iso'
Build 'vmware-iso' errored: 1 error(s) occurred:

* Post-processor failed: Failed: signal: aborted
2016/11/17 13:59:54 ui error: Build 'vmware-iso' errored: 1 error(s) occurred:

* Post-processor failed: Failed: signal: aborted

2016/11/17 13:59:54 Builds completed. Waiting on interrupt barrier...
2016/11/17 13:59:54 machine readable: error-count []string{"1"}
2016/11/17 13:59:54 ui error: 
==> Some builds didn't complete successfully and had errors:
2016/11/17 13:59:54 machine readable: vmware-iso,error []string{"1 error(s) occurred:\n\n* Post-processor failed: Failed: signal: aborted\n"}
2016/11/17 13:59:54 ui error: --> vmware-iso: 1 error(s) occurred:

* Post-processor failed: Failed: signal: aborted
2016/11/17 13:59:54 ui: 
==> Builds finished but no artifacts were created.
2016/11/17 13:59:54 waiting for all plugin processes to complete...

==> Some builds didn't complete successfully and had errors:
--> vmware-iso: 1 error(s) occurred:

* Post-processor failed: Failed: signal: aborted
rickard-von-essen commented 7 years ago

Please supply the information requested in the issue template:

moodwrench commented 7 years ago

packer -v

0.12.0

uname -a

Linux REMOVED 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

full debug output: https://gist.github.com/moodwrench/08b5c041a8debd174c785904122c99aa

config file: https://gist.github.com/moodwrench/65439e1e80a5cadaec046620d5f0466b

moodwrench commented 7 years ago

problem seems to exist in v0.11.0 as well as 0.12.0

mwhooker commented 7 years ago

Any chance you've still got the hostd logs?

jevonearth commented 7 years ago

I have been running into the same issue. Below you will see logs, including hostd.log.

Note that there's no error messages or output from the ovftool printed by packer. This makes troubleshooting harder. If I take the identical arguments shown in the debug output, and run that command manually, upload completes with no errors.

Let me know if there's anything else I can provide to help. Thanks,

# packer-io -v
packer 0.12.2
# uname -a
Linux tower 4.9.11-1-ARCH #1 SMP PREEMPT Sun Feb 19 13:45:52 UTC 2017 x86_64 GNU/Linux

The debug logs from packer;

2017/02/28 16:50:42 packer: Defragmentation completed successfully.
2017/02/28 16:50:42 packer: 2017/02/28 16:50:42 stderr:
2017/02/28 16:50:42 packer: 2017/02/28 16:50:42 Executing: /usr/bin/vmware-vdiskmanager [-k output-acme-centos7-vmware/disk.vmdk]
  Shrink: 100% done.packer: 2017/02/28 16:52:06 stdout: Shrink: 0% done.
2017/02/28 16:52:06 packer: Shrink completed successfully.
2017/02/28 16:52:06 packer: 2017/02/28 16:52:06 stderr:
2017/02/28 16:52:06 packer: 2017/02/28 16:52:06 Writing VMX to: output-acme-centos7-vmware/packer-centos-7-x86_64.vmx
2017/02/28 16:52:06 ui: ==> acme-centos7-vmware: Cleaning VMX prior to finishing up...
==> acme-centos7-vmware: Cleaning VMX prior to finishing up...
2017/02/28 16:52:06 ui:     acme-centos7-vmware: Unmounting floppy from VMX...
2017/02/28 16:52:06 packer: 2017/02/28 16:52:06 Deleting key: floppy0.present
    acme-centos7-vmware: Unmounting floppy from VMX...
2017/02/28 16:52:06 ui:     acme-centos7-vmware: Detaching ISO from CD-ROM device...
    acme-centos7-vmware: Detaching ISO from CD-ROM device...
2017/02/28 16:52:06 ui:     acme-centos7-vmware: Disabling VNC server...
2017/02/28 16:52:06 packer: 2017/02/28 16:52:06 Writing VMX to: output-acme-centos7-vmware/packer-centos-7-x86_64.vmx
    acme-centos7-vmware: Disabling VNC server...
2017/02/28 16:52:06 packer: 2017/02/28 16:52:06 Executing: /usr/bin/vmrun [-T ws list]
2017/02/28 16:52:06 packer: 2017/02/28 16:52:06 stdout: Total running VMs: 0
2017/02/28 16:52:06 packer: 2017/02/28 16:52:06 stderr:
2017/02/28 16:52:06 ui: ==> acme-centos7-vmware: Running post-processor: vsphere
==> acme-centos7-vmware: Running post-processor: vsphere
2017/02/28 16:52:06 ui:     acme-centos7-vmware (vsphere): Uploading output-acme-centos7-vmware/packer-centos-7-x86_64.vmx to vSphere
    acme-centos7-vmware (vsphere): Uploading output-acme-centos7-vmware/packer-centos-7-x86_64.vmx to vSphere
2017/02/28 16:52:06 packer: 2017/02/28 16:52:06 Starting ovftool with parameters: --acceptAllEulas --name=acme-centos7-1488328645 --datastore=ISCSI-Production\ 01 --noSSLVerify=true --diskMode=thick --vmFolder=/packer --network=VM\ Network output-acme-centos7-vmware/packer-centos-7-x86_64.vmx vi://jev-acme%40vsphere.local:narp@192.168.161.129/acme.com/host/HA\ Cluster
2017/02/28 16:52:09 Deleting original artifact for build 'acme-centos7-vmware'
2017/02/28 16:52:10 ui error: Build 'acme-centos7-vmware' errored: 1 error(s) occurred:

* Post-processor failed: Failed: exit status 1

2017/02/28 16:52:10 Builds completed. Waiting on interrupt barrier...
2017/02/28 16:52:10 machine readable: error-count []string{"1"}
2017/02/28 16:52:10 ui error:
==> Some builds didn't complete successfully and had errors:
2017/02/28 16:52:10 machine readable: acme-centos7-vmware,error []string{"1 error(s) occurred:\n\n* Post-processor failed: Failed: exit status 1\n"}
Build 'acme-centos7-vmware' errored: 1 error(s) occurred:
2017/02/28 16:52:10 ui error: --> acme-centos7-vmware: 1 error(s) occurred:

* Post-processor failed: Failed: exit status 1
2017/02/28 16:52:10 ui:
==> Builds finished but no artifacts were created.

2017/02/28 16:52:10 waiting for all plugin processes to complete...
* Post-processor failed: Failed: exit status 1

==> Some builds didn't complete successfully and had errors:
--> acme-centos7-vmware: 1 error(s) occurred:

* Post-processor failed: Failed: exit status 1

==> Builds finished but no artifacts were created.
2017/02/28 16:52:10 /home/jev/go/bin/packer: plugin process exited
2017/02/28 16:52:10 /home/jev/go/bin/packer: plugin process exited
2017/02/28 16:52:10 /home/jev/go/bin/packer: plugin process exited
2017/02/28 16:52:10 /home/jev/go/bin/packer: plugin process exited
2017/02/28 16:52:10 /home/jev/go/bin/packer: plugin process exited

hostd.log logs for the same period

2017-03-01T00:52:02.061Z verbose hostd[E381B70] [Originator@6876 sub=PropertyProvider opID=45010352 user=vpxuser] Recor
dOp ASSIGN: info, haTask--vim.InternalStatsCollector.queryLatestVmStats-164948561. Applied change to temp map.
[LikewiseGetDomainJoinInfo:354] QueryInformation(): ERROR_FILE_NOT_FOUND (2/0):
2017-03-01T00:52:06.051Z verbose hostd[E381B70] [Originator@6876 sub=PropertyProvider] RecordOp ASSIGN: summary.runtime
, ha-root-pool. Sent notification immediately.
2017-03-01T00:52:06.119Z verbose hostd[E381B70] [Originator@6876 sub=PropertyProvider] RecordOp ASSIGN: guest.disk, 206
. Sent notification immediately.
2017-03-01T00:52:06.122Z verbose hostd[EAC2B70] [Originator@6876 sub=PropertyProvider] RecordOp ASSIGN: guest, 206. Sen
t notification immediately.
2017-03-01T00:52:06.122Z verbose hostd[EAC2B70] [Originator@6876 sub=PropertyProvider] RecordOp ASSIGN: summary.guest,
206. Sent notification immediately.
2017-03-01T00:52:06.126Z verbose hostd[E381B70] [Originator@6876 sub=PropertyProvider opID=45010356 user=root] RecordOp
 ASSIGN: info, haTask--vim.AuthorizationManager.retrieveAllPermissions-164948562. Applied change to temp map.
2017-03-01T00:52:06.126Z verbose hostd[E381B70] [Originator@6876 sub=PropertyProvider opID=45010356 user=root] RecordOp
 ASSIGN: info, haTask--vim.AuthorizationManager.retrieveAllPermissions-164948562. Applied change to temp map.
2017-03-01T00:52:10.256Z verbose hostd[E381B70] [Originator@6876 sub=PropertyProvider] RecordOp ASSIGN: guest.disk, 192
. Sent notification immediately.

My postprocessor snippet is as follows;

  "post-processors": [
    {
      "cluster": "HA\\ Cluster",
      "datacenter": "acme.com",
      "datastore": "ISCSI-Production\\ 01",
      "vm_folder": "/packer",
      "host": "{{user `vsphere_host`}}",
      "insecure": "true",
      "only": [
        "acme-centos7-vmware"
      ],
      "password": "{{user `vsphere_password`}}",
      "type": "vsphere",
      "username": "{{user `vsphere_username`}}",
      "keep_input_artifact": true,
      "vm_name": "acme-centos7-{{timestamp}}",
      "vm_network": "VM\\ Network"
    }
palmertime commented 7 years ago

I am affected by this same issue.

packer -v 0.12.3

uname -a Darwin hostname 15.6.0 Darwin Kernel Version 15.6.0: Mon Jan 9 23:07:29 PST 2017; root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64

palmertime commented 7 years ago

Adding debug output.

https://gist.github.com/palmertime/3e57999a53b4fddc64a011d9f8d2eb3c

panni1986 commented 5 years ago

Is there a fix for this issue yet? my post-porcessor snippet:"post-processors": [ { "type": "vsphere", "cluster": "INMD3BZICPCL1", "datacenter": "INMD3BZICPDC", "datastore": "BZICPSDD1", "host": "abcdefxxx.ibm.com", "insecure": true, "username": "administrator@icp.md3.ga", "password": "Red56Blu#$%", "vm_name": "Linux_UBUNTU16_04_4_x86-64_ICP_MD3BZ_PP", "disk_mode": "thin", "vm_network": "Private VMnetwork", "vm_folder": "ICP_Packer", "resource_pool": "INMD3BZICPRP1", "overwrite": "true", "keep_input_artifact": true, "options": [ "--noSSLVerify" ] }

error: Post-processor failed: Error uploading virtual machine: exit status 1

[root@DHCPPacker01 initial_commit]# packer -v 1.3.1 [root@DHCPPacker01 initial_commit]# uname -a Linux DHCPPacker01 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

config json: https://github.ibm.com/Innovation-Lab/packer/blob/test/initial_commit/Ubuntu16.04.4.json

debug log: packer_Ubuntu16.04.log

SwampDragons commented 5 years ago

@panni1986 the error message seems different from the original post's. Does this happen intermittently, or every time?

panni1986 commented 5 years ago

Yes every time. Haven't been successfully yet.

On Wed 17 Oct, 2018, 22:54 Megan Marsh, notifications@github.com wrote:

@panni1986 https://github.com/panni1986 the error message seems different from the original post's. Does this happen intermittently, or every time?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hashicorp/packer/issues/4179#issuecomment-430715711, or mute the thread https://github.com/notifications/unsubscribe-auth/ARAFlPtRw1NLjVeCwWnggNTLCn-dLtgoks5ul2e3gaJpZM4K1sLD .

SwampDragons commented 5 years ago

the fact that it's failing immediately every time says to me that something's wrong with the command. If you omit the post-processor and then run the ovftool command with the listed parameters:

Starting ovftool with parameters: --acceptAllEulas --name=Linux_UBUNTU16_04_4_x86-64_ICP_MD3BZ_PP --datastore=BZICPSDD1 --noSSLVerify=true --diskMode=thin --vmFolder=ICP_Packer --network=Private VMnetwork --overwrite --noSSLVerify output-Linux_UBUNTU16_04_4_x86-64_ICP_MD3BZ_PP/Linux_UBUNTU16_04_4_x86-64_ICP_MD3BZ_PP/Linux_UBUNTU16_04_4_x86-64_ICP_MD3BZ_PP.ovf vi://root:<password>@inmd3bzicpesx2.in.dst.ibm.com/INMD3BZICPDC/host/INMD3BZICPCL1/Resources/INMD3BZICPRP1

what happens?

SwampDragons commented 5 years ago

also, I can't see your json template; it's behind a w3 login page.

j2clerck commented 5 years ago

Hello,

Looking at the ovftool arguments, you have a whitespace in the --network paramater (Private VMnetwork). Can you try with a Network name without space in it or maybe escaping in your json the space?

Regards, Joseph de Clerck

On Wed, Oct 17, 2018 at 11:33 PM Megan Marsh notifications@github.com wrote:

also, I can't see your json template; it's behind a w3 login page.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hashicorp/packer/issues/4179#issuecomment-430797174, or mute the thread https://github.com/notifications/unsubscribe-auth/AH5_bLxOdP2lLkaijOK4vvjn8224XK7_ks5ul6IdgaJpZM4K1sLD .

-- Joseph de CLERCK

SwampDragons commented 4 years ago

I believe many of the problems people were experiencing here are resolved in #9649 and #9589. These PRs have modified the vSphere postprocessor to include a dry run to prevent hanging, better output to enable debugging, and better url encoding. Given how old this issue is, and that some of the problems may have been related to spaces not being encoded and we recently made some changes to encoding to fix that, I'm going to close.

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.