boot_wait ignored with Packer 1.5.1

332 views
Skip to first unread message

Peter Krefting

unread,
Feb 12, 2020, 4:03:24 AM2/12/20
to Packer
Hi!

After upgrading from Packet 1.4.3 to 1.5.1, the boot_command string is
sent too late when building VMWare OVF images on an ESXi 6.7 server. The
boot_command now ends up being typed in the installer instead of the
boot loader. I have set "boot_wait" to "0s" in the configuration, but I
now see a

==> vmware-iso: Waiting 10s for boot...

line in the packer output during build, which was not there before. I
couldn't find anything in the release notes that mention changes to the
boot_wait handling.

This is the "builders" part of the configuration (with sensitive parts
redacted):

"builders": [
{
"type": "vmware-iso",
"remote_type": "esx5",
"remote_host": "10.0.31.140",
"remote_username": "redacted",
"remote_password": "redacted",
"remote_datastore": "redacted",
"remote_cache_datastore": "redacted",
"remote_cache_directory": "packer-iso",
"vnc_disable_password": true,
"format": "ova",
"vm_name": "redacted",
"vmdk_name": "redacted",
"iso_url": "redacted.iso",
"iso_checksum_type": "none",
"ssh_username": "root",
"ssh_password": "redacted",
"ssh_wait_timeout": "30m",
"shutdown_command": "shutdown -P now",
"disk_size": "491520",
"disk_type_id": "thin",
"guest_os_type": "rhel7-64",
"vmx_data": {
"numvcpus": "8",
"memsize": "16384",
"ethernet0.present": "true",
"ethernet0.networkName": "VM Network",
"ethernet0.virtualDev": "vmxnet3",
"ethernet1.present": "true",
"ethernet1.networkName": "Host-Only Network",
"ethernet1.virtualDev": "vmxnet3",
"vmxnet.noOprom": "true",
"vmxnet2.noOprom": "true"
},
"http_directory": "kickstart",
"boot_wait": "0s",
"boot_command": [

"<esc><esc><wait><esc><esc><wait><esc><esc><wait><esc><esc><wait><esc><esc><wait><esc><esc><wait>",
"/isolinux/vmlinuz ",
"inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/redacted.cfg ",
"initrd=initrd.img ",
"inst.stage2=hd:LABEL=redacted ",
"biosdevname=0 net.ifnames=0 ",
"quiet",
"<enter>"
]
}
],

--
\\// Peter - http://www.softwolves.pp.se/

Sylvia Moss

unread,
Feb 12, 2020, 4:14:54 AM2/12/20
to Packer
Hi Peter,

Setting boot_wait to 0s is the same as if you don't set it because zero is the empty value for a time.Duration variable, Packer will then set the default wait time which is 10 seconds, here's the line code where this happens.
If you set to 1s instead it will work and won't need to wait for the entire 10 seconds default, only for 1 second.

If you think this is a bug, I advise you to open an issue on Github https://github.com/hashicorp/packer/issues.


Peter Krefting

unread,
Feb 12, 2020, 4:41:03 AM2/12/20
to packe...@googlegroups.com
2020-02-12 10:14 skrev Sylvia Moss:

> Setting boot_wait to 0s is the same as if you don't set it because zero
> is the empty value for a time.Duration variable, Packer will then set
> the default wait time which is 10 seconds, here's the line code where
> this happens.

Looks like a regression introduced by commit 81932922. Before this, it
would set it to ten seconds if the value was unset, after this it sets
it to ten seconds if it was unset or set to zero.

> If you set to 1s instead it will work and won't need to wait for the
> entire 10 seconds default, only for 1 second.

I will try setting it to one second for now, and see if it still works.
I have had trouble with timing before, but I will try. Thanks!

> If you think this is a bug, I advise you to open an issue on Github
> https://github.com/hashicorp/packer/issues.

Well, it is an undocumented change, at least :-)



[1]
https://github.com/hashicorp/packer/commit/819329228a8dbf82908dc8ccf7c48ab53bfeb2f6#diff-eed61e47b807548499429ebc8afb15bb

Sylvia Moss

unread,
Feb 12, 2020, 4:48:37 AM2/12/20
to Packer
You're right. I think it's valid to open an issue for this! 
Once the commit changes the behavior, others may experience the same problem as you did.
Reply all
Reply to author
Forward
0 new messages