Autoinstall ubuntu 20.04.1 with packer v1.6.6 / vsphere-iso builder / vCenter Server 7.0.0.10300

Hi, not sure if the following problem is related to packer or more an ubuntu question. Well, I start here.
I try to autoinstall ubuntu live-server 20.04.1 on a esxi host using vcenter server v7.0 with packer using its http server to serve the user-data and meta-data file for cloud init. All is working but the ubuntu installer stops at:

[ OK ] Reached target Host and Network Name Lookups

  • Any ideas why the ubuntu installer stop/hangs there?
  • How can I check if the cloud init file ‘user-data’ is picked up from the packer http server from the ubuntu installer?

Thanks and best
Roland

Some more details:
I have a packer *.pkr.hcl file using the vsphere-iso bilder.
The boot_command stanza looks like this and it is working:

boot_command = [
    "<enter><enter>",
    "<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>",
    "/casper/vmlinuz ",
    "initrd=/casper/initrd ",
    "autoinstall ",
    "ds=nocloud-net;s=http://{{.HTTPIP}}:{{.HTTPPort}}/",
    "<enter>"  ]

The output of packer looks like this:

==> vsphere-iso.buildserver: Creating VM...
==> vsphere-iso.buildserver: Customizing hardware...
==> vsphere-iso.buildserver: Mounting ISO images...
==> vsphere-iso.buildserver: Adding configuration parameters...
==> vsphere-iso.buildserver: Starting HTTP server on port 8929
==> vsphere-iso.buildserver: Set boot order temporary...
==> vsphere-iso.buildserver: Power on VM...
==> vsphere-iso.buildserver: Waiting 5s for boot...
==> vsphere-iso.buildserver: HTTP server is working at http://192.168.178.180:8929/
==> vsphere-iso.buildserver: Typing boot command...
==> vsphere-iso.buildserver: Waiting for IP...
==> vsphere-iso.buildserver: IP address: 192.168.178.212
==> vsphere-iso.buildserver: Using ssh communicator to connect: 192.168.178.212
==> vsphere-iso.buildserver: Waiting for SSH to become available...

The http server that packer starts to serve user-data and meta-data is working too.

My meta-data file is empty. The user-data file starts like this:

#cloud-config
autoinstall:
  version: 1
  identity:
    hostname: ubuntu-server
    password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
    username: ubuntu

Maybe you should install openssh-server because Packer is waiting for an ssh connection and I think this it not part of the standard Ubuntu installation without telling it to do so.

In your case Packer should - after a certain amount of time - quit out with an error that an ssh connection could not be established.

The logfile looks fine until that point.

Maybe this could help for the basics:

This thread could be relevant, too:

https://discuss.hashicorp.com/t/packer-ubuntu-20-04-autoinstall-via-cd-drive/18999/6

Yes, you are right. openssh-server is installed after all other setup like username, storage, networking, … has finished.
I think the problem I face is that setup stops at configuring networking an never gets to the point where software packages can be installed.
Thanks to your answer I came to the idea to check what comes after “[ OK ] Reached target Host and Network Name Lookups” on an other ubuntu system.
From the screenshot below you can see that it is cloud-init.
In my understanding this means that “meta-data” and “user-data”, which are exposed by packer by its own web server, are never read/accessed by the ubuntu installer even it is configured within the packer boot_command … “ds=nocloud-net;s=http://{{.HTTPIP}}:{{.HTTPPort}}/”, …

The question is why??

Best Roland

PS: I have read almost every blog on the internet about this topic. The one you mention from imagineer.in was the second best. For me the best one about this topic was this one from Nick Howell: Automating Ubuntu 20.04 images with Packer | Nick Howell