Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Ubuntu VM Waiting for IP #292

Open
horseinthesky opened this issue Nov 29, 2019 · 12 comments
Open

Ubuntu VM Waiting for IP #292

horseinthesky opened this issue Nov 29, 2019 · 12 comments

Comments

@horseinthesky
Copy link

horseinthesky commented Nov 29, 2019

Hello.
Trying to use packer for the first time for deploying Ubuntu VM on my vSphere host.

Got stuck with:

./packer build test.json
vsphere-iso output will be in this color.

==> vsphere-iso: Creating VM...
==> vsphere-iso: Customizing hardware...
==> vsphere-iso: Mount ISO images...
==> vsphere-iso: Creating floppy disk...
    vsphere-iso: Copying files flatly from floppy_files
    vsphere-iso: Copying file: /home/horseinthesky/.packer.d/preseed.cfg
    vsphere-iso: Done copying files from floppy_files
    vsphere-iso: Collecting paths from floppy_dirs
    vsphere-iso: Resulting paths from floppy_dirs : []
    vsphere-iso: Done copying paths from floppy_dirs
==> vsphere-iso: Uploading created floppy image
==> vsphere-iso: Adding generated Floppy...
==> vsphere-iso: Set boot order temporary...
==> vsphere-iso: Power on VM...
==> vsphere-iso: Waiting 10s for boot...
==> vsphere-iso: Typing boot command...
==> vsphere-iso: Waiting for IP...

This is my template:

{
  "builders": [
    {
      "type": "vsphere-iso",
      "vcenter_server": "192.168.0.6",
      "username": "administrator",
      "password": "<supersecretpass>",
      "insecure_connection": "true",
      "vm_name": "example-ubuntu",
      "datacenter": "HomeLab",
      "host": "192.168.0.5",
      "datastore": "860EVO1",
      "network_card": "vmxnet3",
      "network": "Management Network",
      "guest_os_type": "ubuntu64Guest",
      "ssh_username": "horseinthesky",
      "ssh_password": "<supersecretpass>",
      "CPUs": 4,
      "cpu_cores": 2,
      "RAM": 8192,
      "RAM_reserve_all": true,
      "convert_to_template": false,
      "disk_size": 32768,
      "iso_paths": [
        "[WD Red] ISO/ubuntu-18.04.3-server-amd64.iso"
      ],
      "floppy_files": [
        "{{template_dir}}/preseed.cfg"
      ],
      "boot_command": [
        "<enter><wait><f6><wait><esc><wait>",
        "<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>",
        "/install/vmlinuz",
        " initrd=/install/initrd.gz",
        " priority=critical",
        " locale=en_US",
        " file=/media/preseed.cfg",
        "<enter>"
      ]
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "inline": [
        "ls /"
      ]
    }
  ]
}

preseed.cfg is located in the same directory I execute packer.

What do I do wrong?

@jimb0bmij
Copy link

jimb0bmij commented Dec 5, 2019

During your build you need to add at the end of your preseed.cfg "d-i preseed/late_command string apt-install open-vmtools". Also depending on the version of vsphere-iso BIN you are using it will wait FOREVER (version 2.3 does). They need to build a new version of their bin that someone branched and tweaked code to expire after 30mins waiting for IP.

@dnapier
Copy link

dnapier commented Feb 26, 2020

I'm running into the same issue, and it appears in my case the preseed.cfg is not being used.

The console is showing as below:
image

@dnapier
Copy link

dnapier commented Feb 26, 2020

According to #176, the floppy driver was removed from the Ubuntu kernel, which likely explains my problem.

@jf-prevost
Copy link

jf-prevost commented May 21, 2020

During your build you need to add at the end of your preseed.cfg "d-i preseed/late_command string apt-install open-vmtools".

In fact the right package (at least for FocalFossa - 20.04) is open-vm-tools (dash between vm and tools).

@CollinLeishman
Copy link

According to #176, the floppy driver was removed from the Ubuntu kernel, which likely explains my problem.

Hello, what did you do to work around since ubuntu won't read floppies?

@dnapier
Copy link

dnapier commented Sep 30, 2020

I ended up building the image locally using the VMware ISO builder and then pushing it to my vSphere servers with the vSphere post-processor.

@VladRassokhin
Copy link
Collaborator

JFYI: Latest packer supports cd_files and may compose temporarily cdrom same way as floppy

@gyalowitzdtlr
Copy link

You can still feed it in as a floppy

@mikeschinkel
Copy link

@dnapier — Would love to see your Packer JSON or HCL — with sensitive info redacted, of course — if you still have access to those files and are willing to share?

@dnapier
Copy link

dnapier commented May 9, 2022

@mikeschinkel Sorry, I just looked for them and I apparently don't have it anymore. :/

@mikeschinkel
Copy link

@dnapier — Well, at least thanks for looking.

@dmpopoff
Copy link

JFYI: Latest packer supports cd_files and may compose temporarily cdrom same way as floppy

cd_files

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

9 participants