Please test autoinstalls for 20.04!

seriously… how to get rid of the swap file?

In this thread here a more people trieing to achive this…

no mater what i try i end up with:

cat /proc/swaps
Filename                                Type            Size    Used    Priority
/swap.img                               file            4027388 1292    -2

config

  storage:
    grub:
      reorder_uefi: false
    swap:
      filename: swap.img
      size: 0
    layout:
        name: lvm

also tried

  storage:
    grub:
      reorder_uefi: false
    swap:
      size: 0
    layout:
        name: lvm

or

  storage:
    grub:
      reorder_uefi: false
    swap: {swap: 0}
    layout:
        name: lvm

seems bugged for me ?! Anyone has a workarround?

1 Like
  • curtin in-target --target=/target – bash /target/root/advanced_bash.sh

will be work ?
bash script in any variable is need to configure with target prefix ?

Late to the party here but have a few suggestions for docs and elsewhere.

I realize that last suggestion is quite nebulous. It stems from a failing late-command using modprobe and my lack of ability to see into the error. To make some concrete suggestions around this, perhaps the documentation could:

  • Better explain conceptually and more prominently that curtin in-target is effectively a way to run chroot’d commands in the target
  • What factors are “different” about this environment from e.g. a normal login to the box after it’s fully spun up
  • Usage of something like /usr/bin/tail -n 250 /var/log/syslog in error-commands to get hopefully some more debugging detail on failed commands since they are executed through systemd-cat vis a vis curtin
1 Like

could you please focus to implement possibility to run autoinstall fully offline, even if the network is configured, preffered for IoT/Edge devices with wwan connection

most of us are rebuilding the official iso to our needs and not only applying latest patches, but also including security hardenings

it would be great to have it as optional section

if you have the need of an IoT/Edge tailored OS with WWAN support (and adapted data-handling behaviour for WWAN), special security hardening and a rolling release model, have you taken a look at Ubuntu Core yet ? It is designed for particulary this use case and used a lot in IoT/Edge, PLCs, Industrial gateways, Digital Signage and POS systems around the world …

Pre-installing the package ifenslave seems to break the installer.

I’ve been working on a solution to preinstall some packages to make it possible to setup offline targets.

I’ve come up with a script that mounts casper/filesystem.squashfs, chroot-install some packages, configures my autoinstall script (nocloud) and repacking everything into a new filesystem.squashfs. It’s heavily inspired on inject-subiquity-snap.sh following mwhudson’s suggestions : Automated Server Install Quickstart.

But preinstalling ifenslave makes the installer to crash.

Script to reproduce the issue : https://gist.github.com/creatldd1/99db8d68e2a97e2737c5bb488be67328.

Check especially the “PARAMETERS” section before running it.

is it possible to run ansible playbook in late command? i’ve tried it, and it doesnt’ seem work ,possibly due to it being run as chroot…

1 Like

Does autoinstall support ext3 format type because when I set the format type as ext3, ubuntu crashes?

Also is there a way we can set the root password in the user-data section?

I’m trying to get this to work with a more complex LVM setup, but I get a general error during installation. The user-data file parses and validates correctly it would seem, since I’m offered the chance to type “yes” and begin the autoinstall, but I just get an install_fail error from Subiquity after it sets up the partitions.

I’ve tried to reduce this down to what I think is the simplest version of this possible, so I can get it to work before I set up a much more complex layout with more LVM volumes, but I can’t work out what I’m doing wrong here to have it fail:

Edit: I worked out what i was doing wrong and have replaced my storage: section below with a working one. For reference, if anyone faces similar issues in the future, make sure that the device: keys in your mount: stanzas reference the id field from your format stanza, and don’t reference the partition or LVM volume directly.

  storage:
    version: 1
    config:
      - id: disk_sda
        grub_device: true
        name: main_disk
        path: /dev/sda
        ptable: gpt
        type: disk
        wipe: superblock
      - id: part_esp
        type: partition
        size: 600M
        device: disk_sda
        flag: esp
      - id: part_boot
        type: partition
        size: 1GB
        device: disk_sda
        flag: boot
      - id: part_lvm
        device: disk_sda
        size: 20G
        type: partition
      - id: vg_ubuntu
        name: vg_ubuntu
        type: lvm_volgroup
        devices:
          - part_lvm
      - id: lv_root
        name: lv_root
        size: 16G
        type: lvm_partition
        volgroup: vg_ubuntu
      - id: fs_esp
        type: format
        fstype: fat32
        volume: part_esp
      - id: fs_boot
        type: format
        fstype: ext4
        volume: part_boot
      - id: fs_root
        type: format
        fstype: ext4
        volume: lv_root
      - id: mount_root
        type: mount
        path: /
        device: fs_root
      - id: mount_boot
        type: mount
        path: /boot
        device: fs_boot
      - id: mount_esp
        type: mount
        path: /boot/efi
        device: fs_esp
1 Like

Hitting a new issue now - Does the Ubuntu Autoinstall actually support the Curtin syntax for providing options to a mount setting within a config stanza for storage?

I’ve been trying to use the config: option to provide additional settings for the storage: stanza, but I can’t get the options: to take effect in the installed system. A short example of just a mount stanza that I’m trying to use:

      - id: mount_vartmp
        options: 'nodev,noexec,nosuid'
        type: mount
        path: /var/tmp
        device: fs_vartmp

The additional options I provide aren’t used when I run mount on a running system, and they’re also not copied into /etc/fstab like the Curtin docs suggest they should be:

curtin will ensure the target OS uses the provided mount options by updating the target OS (/etc/fstab).

I notice that the Autoinstall Reference specifies:

For full flexibility, the installer allows storage configuration to be done using a syntax which is a superset of that supported by curtin, described at https://curtin.readthedocs.io/en/latest/topics/storage.html.

But the Autoinstall Reference doesn’t describe exactly which of the Curtin options are/aren’t available.

Looking at the Autoinstall Schema doesn’t provide much help either as the schema isn’t very specific about the storage: options that can be used.

Yes, but only in fairly new versions – subiquity version 21.04.1 or newer, so Ubuntu 21.04 is the only released version that supports it, but if you take a focal daily or upgrade the snap during install it should work (the upgrade isn’t offered by default to users of 21.04.2 media because it crashes interactively but if you say refresh: yes channel: stable in an autoinstall it should work). Or wait a couple of weeks for 21.04.3.

This worked – thanks!

For anyone else curious, I added:

  refresh-installer:
    update: true
    channel: 'stable'

to the autoinstall file.

It’s worth noting that it seems to be very picky about the mount options being quoted strings and refuses to go any further if they aren’t quoted. Just one for people to be aware of.

I’ve been able to run ansible-playbook successfully. (Installed via python3-pip, ansible 2.9.x.) What error are you seeing? Try a simple:

- curtin in-target --target=/target -- /bin/sh -c -- 'ANSIBLE_LOG_PATH=/var/log/ansible.log ansible -m ping -o -a data=SMOKETEST localhost'

in late-commands.

I don’t want to wait on autoupdates because I don’t have access to anything in the outside world. I’m sitting in a DMZ and can only see my local subnet, therefore everything I need has to be on the ISO that’s doing the install. So I need the network up but no autoupdates. Security updates will come later as a separate process to all servers.

Update: so yes, it would be nice to have an option to tell autoinstall not to even try doing the autoupdates.

Did you ever figure out if this is problematic? I need the system to either power down or pause on keypress before it reboots.

I have tried read -t which throws an error (anyone know why?), and I have been hesitant to force a powerdown until I was confident there weren’t any side-effects.

Hi there,

Longtime user of preseed so I’m still getting the hang of the new installation tooling, and I have run into a problem for which I am having no luck finding a solution.

Specifically, right after the ramdisk loads and before cloud-init itself starts, there’s a step to request an address via DHCP, and and DHCPDISCOVER packets are sent out on all connected interfaces.

I need some help sorting out how to restrict this to a specific interface (selected by MAC or logical name), as we have scores of servers with multiple interfaces and if the wrong NIC is used to bootstrap, the automated install will fail.

Historically the preseed keyword interface (and the netcfg attribute family in general) could be used to control which NIC was used, but that doesn’t seem to work anymore.

I could use a hand identifying which option(s) I need to use, and suitable values for them.

Here’s my iPXE boot stanza:

imgargs vmlinuz ip=dhcp ipv6.disable=1 interface=eth0 biosdevname=0 net.ifnames=0 root=/dev/ram0 ramdisk_size=1800000
url=http://installserver/images/ubuntu20/ubuntu-20.04.3-live-server-amd64.iso ds=nocloud-net;s=http://installserver/cloud-init/ fsck.mode=skip ro autoinstall initrd=initrd ||
boot ||

and yeah I’m still forcing the kernel to use legacy interface naming but due to the sheer quantity and variety of hardware in our data centers, using systemd’s logical naming convention instead is total a non-starter.

Again, any insights would be very welcome!

thanks,
Klaus

Thank you, much! Where’s the documentation on this?

Hi, I am also facing the same issue (systemd-cat curtin python3 exited with error). Can you please help me?

I am also facing this error. Can anyone please help me? @mwhudson

Hi. I am creating some Packer provisioning profiles for Ubuntu and having a hard time getting the autoinstaller to create additional users.

#cloud-config
autoinstall:

identity:
hostname: template
username: username1
password: $6$HK2Mp6GHbIJqBvrD$.4ClLOTwVO1LEaq4mGJ3FWmJVMJ3uS71UFSqD5ynJVqK9kutaEQLV4YfBYCnXJB3z/lA9X.fOGwFs0SPigp6p.
user-data:
users:
- username: username2
password: $6$oeVvT2UdIsWfSZ6o$m./hIcEbHN.jaw9D4IqXtPamHcOCvb0uaMuVhlKuNSUwHt4/dzhGIod0hB4xj4EDyqHE8wn06n/ra5.IdJma//
groups: [adm, cdrom, dip, plugdev, lxd, sudo]

Username1 gets created and works, username2 doesn’t, what am I doing wrong? Having looked at some more docs, I’ve now also tried “passwd:” instead of password, “name” instead of username as well as lock-passwd: false, but the user simply isn’t getting created at all.

EDIT: solved by removing identity section altogether and defining all users under user-data. Mind you, you will want lock-passwd: false and deliberately define Bash as the shell unless you really do want SH.