ovftool giving curl error

2,494 views
Skip to first unread message

Shyam J

unread,
Aug 2, 2018, 5:32:44 AM8/2/18
to Packer
Hi,

I have a code which creates image in ESX machine in ESX machine(not in the VM where I run code). It works without any problem. This code I am running from a vmware VM.
The same code when I am running from a Azure VM its looking for ovftool to export for the same ESX machine. So when I installed ovftool I am getting below error.

    vmware-iso: Executing: ovftool --noSSLVerify=true --skipManifestCheck -tt=ova vi://root:****@IP/packer-vmware-iso output-vmware-iso
==> vmware-iso: Error exporting virtual machine: exit status 1
==> vmware-iso: Error: cURL error: SSL connect error
==> vmware-iso: Completed with errors

I have not passed the "format" parameter, but it looks for ovftool. Please help

Thanks
Shyam

Shyam J

unread,
Aug 2, 2018, 5:45:27 AM8/2/18
to Packer

Shyam J

unread,
Aug 2, 2018, 5:51:10 AM8/2/18
to Packer
Correction for the error posted I used format, but without "format" alos getting same error.

    vmware-iso: Executing: ovftool --noSSLVerify --noSSLVerify=true --skipManifestCheck -tt=ovf vi://root:****@10.135.128.94/packer-vmware-iso output-vmware-iso
==> vmware-iso: Error exporting virtual machine: exit status 1
==> vmware-iso: Error: cURL error: SSL connect error
==> vmware-iso: Completed with errors
==> vmware-iso:



On Thursday, 2 August 2018 15:02:44 UTC+5:30, Shyam J wrote:

Rickard von Essen

unread,
Aug 2, 2018, 6:24:50 AM8/2/18
to packe...@googlegroups.com
What does the log say if you run with PACKER_LOG=1?

Have you tried running the command manually? What's the output of that? 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/ffeb0774-a5c3-40be-9c27-a3a6c3e7617d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Shyam J

unread,
Aug 2, 2018, 6:37:51 AM8/2/18
to Packer
Yes getting the same error in debug mode also...I couldnt find more details..here is the snippet of it.

:
:
2018/08/02 04:18:06 ui: ==> vmware-iso: Cleaning VMX prior to finishing up...
2018/08/02 04:18:06 ui:     vmware-iso: Unmounting floppy from VMX...
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 Deleting key: floppy0.present
2018/08/02 04:18:06 ui:     vmware-iso: Detaching ISO from CD-ROM device...
2018/08/02 04:18:06 ui:     vmware-iso: Disabling VNC server...
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 Writing VMX to: /tmp/packer-vmx189680565/packer-vmware-iso.vmx
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 [DEBUG] Opening new ssh session
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 [DEBUG] Starting remote scp process:  scp -vt /vmfs/volumes/data_store1/packer-vmware-iso
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 [DEBUG] Started SCP session, beginning transfers...
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 [DEBUG] Copying input data into temporary file so we can read the length
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 [DEBUG] scp: Uploading packer-vmware-iso.vmx: perms=C0644 size=2884
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 [DEBUG] SCP session complete, closing stdin pipe.
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 [DEBUG] Waiting for SSH session to complete.
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 [DEBUG] scp stderr (length 39): Sink: C0644 2884 packer-vmware-iso.vmx
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 [DEBUG] Opening new ssh session
2018/08/02 04:18:06 packer: 2018/08/02 04:18:06 [DEBUG] starting remote command: vim-cmd vmsvc/reload 302
2018/08/02 04:18:07 ui: ==> vmware-iso: Exporting virtual machine...
2018/08/02 04:18:07 ui:     vmware-iso: Executing: ovftool --noSSLVerify=true --skipManifestCheck -tt=ova vi://root:****@IP/packer-vmware-iso output-vmware-iso
2018/08/02 04:18:08 ui error: ==> vmware-iso: Error exporting virtual machine: exit status 1
==> vmware-iso: Error: cURL error: SSL connect error
==> vmware-iso: Completed with errors
==> vmware-iso:
==> vmware-iso:
2018/08/02 04:18:08 packer: 2018/08/02 04:18:08 [DEBUG] Opening new ssh session
2018/08/02 04:18:08 packer: 2018/08/02 04:18:08 [DEBUG] starting remote command: vim-cmd vmsvc/power.getstate 302
2018/08/02 04:18:09 ui: ==> vmware-iso: Destroying virtual machine...
2018/08/02 04:18:09 packer: 2018/08/02 04:18:09 [DEBUG] Opening new ssh session
2018/08/02 04:18:09 packer: 2018/08/02 04:18:09 [DEBUG] starting remote command: vim-cmd vmsvc/destroy 302
2018/08/02 04:18:09 packer: 2018/08/02 04:18:09 [DEBUG] Opening new ssh session
2018/08/02 04:18:09 packer: 2018/08/02 04:18:09 [DEBUG] starting remote command: test ! -e /vmfs/volumes/data_store1/packer-vmware-iso
2018/08/02 04:18:09 packer: 2018/08/02 04:18:09 [ERROR] Remote command exited with '1': test ! -e /vmfs/volumes/data_store1/packer-vmware-iso
2018/08/02 04:18:09 packer: 2018/08/02 04:18:09 [DEBUG] Opening new ssh session
2018/08/02 04:18:10 packer: 2018/08/02 04:18:10 [DEBUG] starting remote command: test ! -e /vmfs/volumes/data_store1/packer-vmware-iso
2018/08/02 04:18:10 packer: 2018/08/02 04:18:10 [ERROR] Remote command exited with '1': test ! -e /vmfs/volumes/data_store1/packer-vmware-iso
2018/08/02 04:18:10 packer: 2018/08/02 04:18:10 [DEBUG] Opening new ssh session
2018/08/02 04:18:10 packer: 2018/08/02 04:18:10 [DEBUG] starting remote command: test ! -e /vmfs/volumes/data_store1/packer-vmware-iso
2018/08/02 04:18:10 packer: 2018/08/02 04:18:10 [DEBUG] Opening new ssh session
2018/08/02 04:18:10 packer: 2018/08/02 04:18:10 [DEBUG] starting remote command: test -e /vmfs/volumes/data_store1/packer-vmware-iso
2018/08/02 04:18:10 packer: 2018/08/02 04:18:10 [ERROR] Remote command exited with '1': test -e /vmfs/volumes/data_store1/packer-vmware-iso
2018/08/02 04:18:10 [INFO] (telemetry) ending vmware-iso
2018/08/02 04:18:10 ui error: Build 'vmware-iso' errored: Error exporting virtual machine: exit status 1
Error: cURL error: SSL connect error
Completed with errors


2018/08/02 04:18:10 Builds completed. Waiting on interrupt barrier...
2018/08/02 04:18:10 machine readable: error-count []string{"2"}
2018/08/02 04:18:10 ui error:
==> Some builds didn't complete successfully and had errors:
2018/08/02 04:18:10 machine readable: virtualbox-iso,error []string{"Output directory exists: output-rhel75\n\nUse the force flag to delete it prior to building."}
2018/08/02 04:18:10 ui error: --> virtualbox-iso: Output directory exists: output-rhel75

Use the force flag to delete it prior to building.
2018/08/02 04:18:10 machine readable: vmware-iso,error []string{"Error exporting virtual machine: exit status 1\nError: cURL error: SSL connect error\nCompleted with errors\n\n"}
2018/08/02 04:18:10 ui error: --> vmware-iso: Error exporting virtual machine: exit status 1
Error: cURL error: SSL connect error
Completed with errors

2018/08/02 04:18:10 ui:
==> Builds finished but no artifacts were created.
2018/08/02 04:18:10 [INFO] (telemetry) Finalizing.
2018/08/02 04:18:11 waiting for all plugin processes to complete...
2018/08/02 04:18:11 /usr/bin/packer: plugin process exited
2018/08/02 04:18:11 /usr/bin/packer: plugin process exited
2018/08/02 04:18:11 /usr/bin/packer: plugin process exited
2018/08/02 04:18:11 /usr/bin/packer: plugin process exited
:
:

Yes tried command manually like below. The source ovf file is the one created on ESX machine when packer is run from vmware VM. Transferred the files to Azure VM and ran like below.

[root@server_name output-vmware-iso]# ls
disk-flat.vmdk  disk.vmdk  packer-s2.nvram  packer-s2.vmsd  packer-s2.vmx  packer-s2.vmxf
[root@server_name  output-vmware-iso]# ovftool packer-s2.vmx packer-s2.ova
Opening VMX source: packer-s2.vmx
Opening OVA target: packer-s2.ova
Writing OVA package: packer-s2.ova
Transfer Completed
Completed successfully

Note: I am running virtualbox also along with it.

Shyam J

unread,
Aug 3, 2018, 9:00:07 AM8/3/18
to Packer
Hi,
If this question doesnt have an answer now its fine, I can wait.

But can you tell me why when format is not mentioned also packer is looking for ovftool to export in Azure VM? Why cant it keep the exports in ESX machine?

Thanks
Shyam

Alvaro Miranda Aguilera

unread,
Aug 3, 2018, 4:40:06 PM8/3/18
to packe...@googlegroups.com
hello


azure?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/5b359b54-65fe-410f-8379-b4d95cd78711%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Shyam J

unread,
Aug 5, 2018, 11:36:50 PM8/5/18
to Packer
Yes when running the same packer code from a vmware VM which outputs in ESX machine while when running packer code from azure VM looking for ovftool.

Thanks
Shyam


On Saturday, 4 August 2018 02:10:06 UTC+5:30, Alvaro Miranda Aguilera wrote:
hello


azure?

On Fri, Aug 3, 2018 at 3:00 PM, Shyam J <shya...@gmail.com> wrote:
Hi,
If this question doesnt have an answer now its fine, I can wait.

But can you tell me why when format is not mentioned also packer is looking for ovftool to export in Azure VM? Why cant it keep the exports in ESX machine?

Thanks
Shyam

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.



--
Alvaro

Alvaro Miranda Aguilera

unread,
Aug 5, 2018, 11:50:46 PM8/5/18
to packe...@googlegroups.com
ovftool is a vmware tool.

if you share your packer template, I can sugges some filters. but you shouldn't be running ovftool on non vmware setups.

you can add "only": ["vmware-iso"] to restrict a provisioner/post-processor

alvaro

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/529f6a3c-a77b-4b10-807a-2a8f7c7574f3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Shyam J

unread,
Aug 6, 2018, 5:20:50 AM8/6/18
to Packer
Hi Alvaro,

I think you got me wrong. I didnt explain it properly also. I am running a vmware-iso builder only, but this is being run from a Azure VM contacting a ESX machine.
Below is my code. My question is why image is getting exported to this azure VM. When I run the same code from a vmware VM it creates the image in ESX machine itself. Both cases I am not using 'format' option.

Thanks in advance

{
  "variables": {
    "vm_name": "packer",
    "vm_description": "rhel7 base",
    "iso": "/data/rhel-server-7.5-x86_64-dvd.iso",
    "checksum": "d0dd6ae5e001fb050dafefdfd871e7e648b147fb2d35f0e106e0b34a0163e8f5",
    "iso_checksum_type": "sha256",
    "remote_password" : "{{env `ESX_SSH_PASS`}}",
    "ssh_password": "{{env `VM_SSH_PASS`}}"
  },

  "builders": [
    {
      "type": "vmware-iso",
      "ssh_username": "packer",
      "ssh_password": "{{ user `ssh_password` }}",
      "ssh_port": 22,
      "ssh_wait_timeout": "30m",
      "http_directory": "./",

      "vm_name": "{{ user `vm_name` }}",
      "guest_os_type": "rhel7-64",
      "iso_url": "{{ user `iso` }}",
      "iso_checksum": "{{ user `checksum` }}",
      "iso_checksum_type": "{{ user `iso_checksum_type` }}",
      "tools_upload_flavor": "linux",
      "remote_datastore": "datastore_name",
      "remote_host": "IP_ESX",
      "remote_password": "{{ user `remote_password` }}",
      "remote_type": "esx5",
      "remote_username": "root",
      "disk_size": "32000",
      "headless": false,
      "vnc_port_min": 5980,
      "vnc_port_max": 5990,
      "vmx_data": {
      "memsize": 512,
      "ethernet0.networkName": "network_name",
      "ethernet0.present": "TRUE",
      "ethernet0.startConnected": "TRUE",
      "ethernet0.virtualDev": "e1000",
      "ethernet0.addressType": "generated",
      "ethernet0.generatedAddressOffset": "0",
      "ethernet0.wakeOnPcktRcv": "FALSE",
      "numvcpus": 1
      },

      "boot_wait": "10s",
      "boot_command": [
        "<esc><wait>",
        "vmlinuz initrd=initrd.img net.ifnames=0 biosdevname=0 ",
        "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks4.cfg ip=IP netmask=maske_details gateway=gatwway_details<enter><wait>"
      ],

     "shutdown_command": "echo '{{ user `username` }}' | sudo -S shutdown -P now"
    }
  ]
}


Shyam



--
Alvaro

Shyam J

unread,
Aug 7, 2018, 5:57:46 AM8/7/18
to Packer
Hi Alvaro,

Did you get a chance to look at this?

Thanks
Shyam

Alvaro Miranda Aguilera

unread,
Aug 7, 2018, 4:10:29 PM8/7/18
to packe...@googlegroups.com
i read the update

but i don't understand the problem at all

this part makes all hard to follow: " why image is getting exported to this azure VM"

What is getting exported to AzureVM ?

If you share debug logs those can help

but explanation is hard to follow as is.

Shyam J

unread,
Aug 14, 2018, 7:47:19 AM8/14/18
to Packer
This is how it is.

Packer server (Azure VM) > Remote ESXi > Looks for ovftool to export
Packer server (Vmware VM) > Remote ESXi > Skips exports locally and exports in ESX machine. 

Both are talking with the same ESXi server. Skip_export or 'format' flag is not mentioned in both cases.

Thanks
Shyam

Gabo Kete

unread,
Aug 14, 2018, 5:10:01 PM8/14/18
to Packer
Have you installed Ovftool on both VMs ( Azure and VMWare ) ? as far as I remember, packer uses their own ovftool internally.. so try to remove the one you have installed yourself and let packer handle it

Shyam J

unread,
Aug 28, 2018, 1:42:13 AM8/28/18
to Packer
Only in Azure VM i had to install ovftool because packer is looking for it while exporting. Its not exporting to ESX datastore. Its looking in azure VM, so when I installed its not looking anymore but gets the curl error.
In VMware VM I didnt need to install ovftool, packer was exporting to ESX machine.
IN both cases I didnt use format option.

Thanks for checking this.
Shyam
Reply all
Reply to author
Forward
0 new messages