Please test autoinstalls for 20.04!

I’m facing the exactly same issue.
User created via CI-DATA drive is not working.
Have you found another way than repacking a new iso with the commands inside?

A (very ugly) solution is to set the encrypted password using late-commands but i don’t really like it.

And I finally committed a fix for this.

Thanks, I’ve tested with today’s edge channel and all is OK.

1 Like

It took some trial and error but I got a late-command working that sets up rootfs and home btrfs subvolumes.

Complete example autoinstall for EFI systems.

For some reason I’m still getting swap.img in addition to my swap partition in the fstab. The presence of a swap partition and the root partition being btrfs should prevent swap.img from being added based on what I see in the code. :confused:

Nice!

At some point, I’m going to add a documentation page with some examples. Would you be OK with your example being used on it?

Hmm it looks like the logic for that doesn’t actually fire in the autoinstall case. Can you file a bug? You can probably work around this by adding something like this to your config:

storage:
    config: ...
    swap: {swap: 0}

Would you be OK with your example being used on it?

Sure!

Can you file a bug?

You can probably work around this by adding something like this to your config

That worked, thank you.

We have to move from 16.04 to 20.04 in our company and I was quite surprised that the old autoinstall does not work as it used to for last years but there is a new way to do that. But I was quite furious about really poor documentation and it took me hours to figure out some basic things. Currently I’m banging my head with next things:

  • how to create end enable root user (it’s created, but not enabled) - I know, using root is bad but since machines logs to NIS, I need user that has local home, not on NFS. And autoinstall does not cover that either, so I rely on heavy scripting after installation

  • with old autoinstall method machines got hostname from DHCP and DNS automagically, now I can’t achieve that. If I omit hostname, installer reports error and stops

  • is there any document that shows all user-data parameters that actually works? This document does not seem to cover it properly

  • how to make default language and locale for whole system, locale does not install system language

I know it was about time to move forward and do some changes on this area but I’m really stuck with mostly unsuccessful solutions by googling.

I’m sorry you’ve found this frustrating. The autoinstall stuff is all very new and the documentation is a bit behind. We’ll get there.

Most of these can be solved by putting into user-data, which gets passed directly to cloud-init to configure the system on first boot. cloud-init has its own documentation.

user-data:
    disable_root: false

Should do this. You’ll probably want to have ssh_authorized_keys in there as well.

If you have user-data, you don’t need to have any identity section, including hostname. And if you don’t provide any other configuration I think the hostname from DHCP will be used (I haven’t tried this).

For the user-data section, you want the cloud-init docs as above. The autoinstall docs really should like to the cloud-init docs, I’ll add that tomorrow.

Not sure about this one sorry.

Thanks for some useful hints.

Hostname is really set when you exclude whole identity section from user-data.
And with “disable_root: false” I get root user that I can login using ssh keys.

I hope I figure out how to properly read documentation since I put everything in user-data file, that starts from boot parameter “root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://server/kickstart/focal-amd64.iso autoinstall ds=nocloud-net;s=http://server/kickstart/”

Hello

Since a few days I can’t get the user creation to work.
I tried with or without quotes. I tried to generate the password hash with or without salt.
But this just doesn’t work anymore. After the installation if I boot I can’t connect with any accounts.
Did somebody has the same problem ? (please note that one week ago this was working fine)

  identity:
    hostname: "my-workstation"
    realname: "my account"
    username: "myuser"
    password: "$6$xxxxxxxxxxxxxxxxxx"

Which install media are you using? Are you refreshing the installer as part of the install? We released a new version a week ago which changed how this end of things works a little, but obviously the goal was to make this more reliable, not less!

Can you share any more details about how you are performing the install, e.g. are you providing the config over the network or via a filesystem with label cidata or some other way?

Hello,

We are trying to support and deploy Ubuntu machines in our company.
Thats why we are testing the autosinstalls in order to package Ubuntu on new computers for employees.

We are deploying the installation through the network with “autoinstall ds=nocloud-net;s=http://gateway/” in Grub menu

Everything is working fine in the autoinstall process from the hard drive partitioning and encryption to the post-installation commands.

Only 2 things are not working like expected:

  • the network part (we had to remove it from the user-data file or the installation fails)
  • the identity part: it doesn’t mater what we put inside this section at the end after the installation and the first boot there is no user account. (if we install ubuntu-desktop during the process we get a menu asking to create a new account after the first boot like with the old oem installation process)

I just tested without using the latest installer (I remove the refresh-installer: section)
And the account creating seems to work fine. (but the harddrive section doesn’t)

After a few investigation il looks like that the account creation works fine if I remove some
late-commands at the end. This may be linked to a specific command I run at the end

1 Like

So, still having some auto-install issues. However, my primary concern currently is that Plymouth always turns any 20.04 installation into a 25+ minute wait.

  1. It fails to mount /dev/sdc (which is true) it doesnt exist
  2. it gets connection refused for Plymouth
  3. 25 minutes later it says nothing is wrong and continues.

Auto installed or not. I have been able to find basically no information on it. I know its the stupid splashscreen application, but why does this halt booting? how is anything dependent on it?
I’ll try to get screenshots/logs.

Huh that’s really strange. It’s true that there is a connection refused message about plymouth but that’s because plymouth is not present on the server ISO (this message will be hidden for 20.04.1 IIRC). It definitely shouldn’t be caused a 20 minute (!!) delay. Do have “quiet” on your kernel command line? Do you get any more output if you remove it?

I’m suffering from the issue about getting hostname from DHCP server. I’d tried late-command to use shell script to change hostname with sed but I failed.

For now I can change the prompt by putting user-data section and commenting out identity section. But still I don’t think it’s perfect yet.

/etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localho6.localdomain6 localhost6

/etc/hostname
localhost.localdomain

How can I change the localhost information to the hostname from my DHCP server? I think the beginning of automation linux administration starts from the unattended installation.

Normally we default to acquiring dhcp lease, storing it, and using hostname from it.

When we do dhcp lease, we use predictable random clientid based on the interface name & machine-id.

We do not use MAC address as Client ID as used to be common in the past, but often enough leads to duplication / impersonation, or privacy leaks.

Can you boot interactive installer and switch to shell either using help menu, or by switchting to a spare tty?

From there you can check the network status with $ networkctl and check the contents of leases in /run/systemd/netif/leases

You should there find state files, of leases that systemd-networkd-dhcp-clinet has received. Is there a hostname you expect there? or is there not?

If not, you can either troubleshoot your dhcp server (if you control it and can change it), or you can tweak the clinet.

In /etc/netplan you can switch to MAC addressed based dhcp Client ID, which may cause dhcp server to behave differently, and issue a different lease with the expected hostname, which then should be picked up. Specifically from https://netplan.io/reference#common-properties-for-all-device-types there is dhcp-identifier: mac option that will change the behaviour of the systemd-networkd-dhcp-client. After changing that, you can try to do $ netplan apply, and like bring the device down / up, to request a new lease.

Maybe then you can inspect leases in /run again, it is what you expect, and then you could include the netplan config with that setting in your autoinstall.yaml.

Or try to fix your dhcp-server to recognise the client-ids you want.

This is more of netplan question however, I do not believe there is anything installer specific about this issue.

  • The new installer configuration file is more readable and organized than debian-installer.
  • It’s very nice that it doesn’t ask any question unless required and handles everything by itself (or crashes)

Few issues/questions:

  1. Is there a way to run in a more forgiving mode and make installer just go to next package, if a package under “packages” section doesn’t exist?
  2. Is there a way to NOT install certain packages (For instance, I want ubuntu-desktop, but with some packages excluded
  3. While using user-data instead of identity, it would be nice to be able to set hostname (without relying on the hostname given by DHCP). I use a dhcp server that assign a certain IP/hostname during installation, but the installed system should have a different IP/hostname configuration.

Cheers and thanks for the good work!

Thanks for your kind explanation.

The contents of leases in /run/systemd/netif/leases/2 is perfect. And I think I don’t need to switch ‘dhcp-identifier: mac’ option on, because it’s already checked as default value. My netplan config file is configured automatically like this.

network:
  ethernets:
    enp1s0:
      critical: true
      dhcp-identifier: mac
      dhcp4: true
      nameservers:
        addresses:
        - 172.30.100.199
        search:
        - linuxmaster.com
  version: 2

Wrong host information of previous post has been occasioned by user-data file which I modified as other posts.

/etc/hosts

127.0.0.1 localhost.localdomain localhost
::1 localho6.localdomain6 localhost6

/etc/hostname

localhost.localdomain

This is my user-data file.

#cloud-config
autoinstall:
  version: 1
  user-data:
    hostname: guest
    password: [password]
    username: ubuntu

I just wonder why this happens.