vSphere post-processor is very slow to import into , is this normal?

9 views
Skip to first unread message

Steven Stratis

unread,
Feb 6, 2019, 3:30:09 PM2/6/19
to Packer
Since Packer uses ovftool to handle the importing of the vmx into vSphere, it can take a very long time for the export to complete (well over an hour normally). Is this the expected behavior from the post-processor? 

Is there a recommended approach for speeding it up, such as compressing drives or something a long those lines. I'm new to building VMware images and working with vSphere so I'm not sure if compression is an option in this case since it's importing a vmx into vSphere. 

Below is an example of my packer script. 
```{
"builders": [
{
"type": "vmware-iso",
"boot_command": [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz<wait>",
" auto<wait>",
" console-setup/ask_detect=false<wait>",
" console-setup/layoutcode=us<wait>",
" console-setup/modelcode=pc105<wait>",
" debconf/frontend=noninteractive<wait>",
" debian-installer=en_US.UTF-8<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.UTF-8<wait>",
" netcfg/get_domain=vm<wait>",
" netcfg/get_hostname=ubuntubase<wait>",
" grub-installer/bootdev=/dev/sda<wait>",
" noapic<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}<wait>",
" -- <wait>",
"<enter><wait>"
],
"boot_wait": "10s",
"disk_size": "{{user `disk_size`}}",
"guest_os_type": "ubuntu-64",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"output_directory": "../vmware/builds/{{user `template`}}",
"shutdown_command": "echo 'dev' | sudo -S shutdown -P now",
"ssh_password": "dev",
"ssh_port": 22,
"ssh_username": "dev",
"ssh_wait_timeout": "10000s",
"tools_upload_flavor": "linux",
"vm_name": "{{ user `template` }}",
"vmx_data": {
"cpuid.coresPerSocket": "1",
"ethernet0.pciSlotNumber": "32",
"memsize": "{{ user `memory` }}",
"numvcpus": "{{ user `cpus` }}"
}
}
],
"post-processors": [
{
"type": "vsphere",
"cluster": "{{user `vsphere_cluster`}}",
"datacenter": "{{user `vsphere_datacenter`}}",
"datastore": "{{user `vsphere_datastore`}}",
"host": "{{user `vsphere_domain`}}",
"password": "{{user `vsphere_pass`}}",
"username": "{{user `vsphere_user`}}",
"vm_name": "{{user `template`}}",
"esxi_host": "{{user `vsphere_esxi`}}",
"insecure": "{{user `vsphere_insecure`}}",
"vm_folder": "{{user `vsphere_vmfolder`}}",
"vm_network": "{{user `vsphere_network`}}",
"options": ["--machineOutput"]

}
],

```
Reply all
Reply to author
Forward
0 new messages