Export VM as ovf using packer's vmware-iso builder

39 views
Skip to first unread message

Pearl Dsilva

unread,
Aug 20, 2019, 2:53:04 AM8/20/19
to Packer
I am trying to build an image using vmware-iso and want the image to be finally exported as an ovf image. Setting the "format" configuration option to "ovf" in vmware-iso builder doesn't seem to create an ovf image. Is there a way to achieve it.

Rickard von Essen

unread,
Aug 20, 2019, 3:14:37 AM8/20/19
to packe...@googlegroups.com
It should. Can you please give some more details, your template, what you saw, what you expected, etc. 

On Tue, Aug 20, 2019, 08:53 Pearl Dsilva <pearl....@rubrik.com> wrote:
I am trying to build an image using vmware-iso and want the image to be finally exported as an ovf image. Setting the "format" configuration option to "ovf" in vmware-iso builder doesn't seem to create an ovf image. Is there a way to achieve it.

--
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/daf1c35f-2a73-424a-afc8-be80725790b1%40googlegroups.com.

Pearl Dsilva

unread,
Aug 20, 2019, 5:14:36 AM8/20/19
to Packer
This is the template that I am currently using, which creates vmx and vmdk files.

```
{
  "builders": [
    {
      "type": "vmware-iso",
      "format": "ovf",
      "iso_url": "{{user `url`}}",
      "iso_checksum": "{{user `checksum`}}",
      "iso_checksum_type": "sha256",
      "ssh_username": "ubuntu",
      "ssh_password": "xxxxxxxxxx",
      "ssh_wait_timeout": "30m",
      "disk_size": "20480",
      "headless": false,
      "shutdown_command": "echo 'xxxxxxxx'|sudo -S /sbin/halt -h -p",
      "http_directory": "http",
  "http_port_min":9001,
  "http_port_max":9001,
  "vnc_bind_address": "0.0.0.0",
  "vnc_disable_password":true,
  "vnc_port_min": 5902,
  "vnc_port_max": 5902,
  "vm_name": "example",
  "network":"hostonly",
  "remote_type": "esx5",
  "remote_host": "x.x.x.x",
  "remote_username": "abc",
  "remote_password": "yyyyyyyyyy",
  "remote_datastore": "xxxxxxx",
  "remote_cache_datastore": "xxxxxxx",
  "remote_cache_directory": "packer_test",
  "skip_compaction": true,
  "skip_export": true,
  "boot_wait": "0s",
      "boot_command": [  
    "<esc><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><wait>",
        "/install/vmlinuz noapic<wait>",
        " auto<wait>",
        " console-setup/ask_detect=false<wait>",
        " console-setup/layoutcode=us<wait>",
        " console-setup/modelcode=pc105<wait>",
        " debconf/frontend=noninteractive<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
        " debian-installer=en_US<wait>",
        " fb=false<wait>",
        " initrd=/install/initrd.gz<wait>",
        " kbd-chooser/method=us<wait>",
        " keyboard-configuration/layout=USA<wait>",
        " keyboard-configuration/variant=USA<wait>",
        " locale=en_US<wait>",
        " netcfg/get_domain=vm<wait>",
        " netcfg/get_hostname=ubuntu<wait>",
        " grub-installer/bootdev=/dev/sda<wait>",
        " -- <wait>",
        "<enter><wait>"
      ],
  
      "vmx_data": {
"ethernet0.present": true,
"ethernet0.networkName": "VM Network"
      },
      "vmx_data_post": {
        "floppy0.present": false
      }
    }
  ],
  "provisioners": [
{
"type": "shell",
"script": "scripts/prepenv_ubuntu.sh"
}
  ]
}
```

On Tuesday, August 20, 2019 at 12:44:37 PM UTC+5:30, Rickard von Essen wrote:
It should. Can you please give some more details, your template, what you saw, what you expected, etc. 

On Tue, Aug 20, 2019, 08:53 Pearl Dsilva <pearl...@rubrik.com> wrote:
I am trying to build an image using vmware-iso and want the image to be finally exported as an ovf image. Setting the "format" configuration option to "ovf" in vmware-iso builder doesn't seem to create an ovf image. Is there a way to achieve it.

--
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 packe...@googlegroups.com.

Rickard von Essen

unread,
Aug 20, 2019, 12:39:11 PM8/20/19
to packe...@googlegroups.com
you have  "skip_export": true

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/c2df6d05-380a-47ef-8625-087a3c59eab0%40googlegroups.com.

Pearl Dsilva

unread,
Aug 21, 2019, 12:47:30 AM8/21/19
to Packer
On removing the "skip_export" parameter, I encountered the following error:

Error: ExtraConfig options exists in source (use --allowExtraConfig option to allow this)

So, I added the following to the configuration:
 "ovftool_options": "--allowExtraConfig",

After which the build seems to get stuck at the following point:
ovftool.PNG


Any pointers on how to overcome this issue.



On Tuesday, August 20, 2019 at 10:09:11 PM UTC+5:30, Rickard von Essen wrote:
you have  "skip_export": true

Reply all
Reply to author
Forward
0 new messages