Score:0

Ubuntu autoinstall, how to actually get it to work?

bi flag

I am having major trouble building a working autoinstall process. This is for 20.04.2.0; first, testing it with a VMware ESXI host.

What I thought I could do:

  • Boot the VM off the ISO and,
  • Specify parameters at the kernel prompt to pull in autoinstall data and build the VM

The kernel/boot args I've recently tested (boot ISO, press SHIFT, enter commands):

  1. vmlinuz=/casper/vmlinuz initrd=/casper/initrd autoinstall ip=dhcp ds=nocloud-net;s=http://our-mirror/media/ubuntu-20.04.2.0/

  2. root=/dev/ram0 ramdisk_size=1500000 fsck.mode=skip autoinstall ds=nocloud-net;s=http://our-server/media/[contains user-data etc] ip=dhcp url=http://our-server/media/ubuntu-20.04.3-live-server-amd64.iso cloud-config-url=http://our-server/media/ [seems redundant] — splash

and a few variations of the above, based on different examples. There are many differing opinions about how this should work--the documentation I have found challenging.

Thus far, nothing has worked. I see the HTTP pull of the user-data, meta-data and vendor-data, but generally the process will crash/stop.

In one instance, Ubuntu created SSH keys and halted the install -- to facilitate login and log review. Great, save for the fact that you cannot copy-and-paste on VMware's console without VMware-tools installed. But, I did catch a couple of errors:

"no kernel command line url found"

and

"no local datasource found"

which I find puzzling. Shouldn't I be able to boot off the ISO of the same release, and point the installer to the autoinstall data and have it run? I have also tried booting off the ISO and having it pull/install from an HTTP ISO, multiple combinations of things. NO luck.

I do not understand the need for separate user-data, vendor-data and meta-data files -- it seems unnecessary, or it could simply be included under a YAML configuration in the autoinstall file ("user-data") or why those files MUST be in the root of the ISO directory. That won't scale if you are deploying different types of installations.

Kickstart isn't this complicated and is better documented.

We do have PXE available and we will be using Foreman, but we're not even close to that until I get a workable autoinstall. And for Foreman, you have to break down the install a bit (partitioning, provisioning).

I'm hoping someone can help clarify how to get this working; I've spent a lot of time trying to figure this out :)

Thanks in advance.

Andrew Lowther avatar
jp flag
Some tips. 1. Make sure your VM has 3GB of memory or more. 2. if there are HTTP requests for `user-data`, `meta-data`, and `vendor-data` then the boot command is fine. Start digging into whether the `autoinstall` config is valid. 3. in the VMware console you can setup credentials so you can login over SSH, which is often easier for investigating problems.
Forrest Aldrich avatar
bi flag
The VM I have has 4GM of RAM. From reading and following what docs I could find and I cannot get this to work. The docs are lacking (another topic). What I'm doing is (I believe) simple. I "should" be able to do this from a standard ISO. But it may be that I need to somehow customize the ISO and put in basic autoinstall there, then further customize it from Foreman. The point of this is automation. If I have to jump through several steps to get it working, that defeats the purpose. I see that Cononical publishes "cloud images" but we're not there yet.
Forrest Aldrich avatar
bi flag
There must be a tool other than yamllint that I can pass an autoinstall script through to validate against the schema.
Forrest Aldrich avatar
bi flag
I see this link [link](https://askubuntu.com/questions/1438351/unable-to-create-custom-iso-ubuntu-22-04-using-autoinstall) that suggests stuffing your *-data files into a separate ISO? I can do that, but I don't see how that will change what's happening yet.
Forrest Aldrich avatar
bi flag
I increased the RAM from 4 to 10GB and got a bit more done. It is not reading my autoinstall data; presenting me with interactive menus to determine disk layout, which I've seen before. The log has an error "No kernel command line url found". Here's what I used (edited): root=/dev/ram0 ramdisk_size=1600000 fsck.mode=skip autoinstall ds=nocloud-net;s=http://MyIP/dist-with-data-files/ ip=dhcp cloud-config-url=http://MyIp/dist-with-data-files/meta-data - - -
Andrew Lowther avatar
jp flag
Because you are booting from an ISO and customizing the boot commands you may want to look at some autoinstall tutorials that use Packer. It is a common pattern with Packer to boot from the ISO and provide custom boot commands.
Forrest Aldrich avatar
bi flag
We are using Foreman and Puppet in our environment. I can't even fathom trying to get this working in that environment yet -- today I tried building a custom ISO form the LIVE ISO, with a modified grub.cfg and the user-data and meta-data under the / directory. It just feels like the implementation here is a bit of a mess. Today, I was trying to get this to work on a simple VMware VM, no luck. Since my original post, I see others are complaining about the same things.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.