Using Autoinstall with cloud-init scripts

I have been trying to find a way to use autoinstall inside of cloud-init. Assuming i use something like this:

#cloud-config
autoinstall:
version: 1
identity:
hostname: test-vlan353

The system comes up during deployment stating that subiquity is required, so I added this:

#cloud-config
snap:
commands:
0: snap install subiquity --classic

autoinstall:
version: 1
identity:
hostname: test-vlan353

But then I get this error:
2024-11-19 15:49:04,263 ERROR root:38 finish: subiquity/apply_autoinstall_config: FAIL: Command ‘[‘systemd-run’, ‘–wait’, ‘–same-dir’, ’
–property’, ‘SyslogIdentifier=subiquity_log.4919’, ‘–setenv’, ‘PATH=/snap/subiquity/6190/bin:/snap/subiquity/6190/usr/bin:/usr/local/sbi
n:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/subiquity/6190/bin:/snap/subiquity/6190/sbin’,
‘–setenv’, ‘PYTHONPATH=:/snap/subiquity/6190/lib/python3.10/site-packages’, ‘–setenv’, ‘PYTHON=/snap/subiquity/6190/usr/bin/python3.10’,
‘–setenv’, ‘SNAP=/snap/subiquity/6190’, ‘–’, ‘mount’, ‘-o’, ‘lowerdir=/media/filesystem,upperdir=/tmp/tmpl0u0wuyh/upper,workdir=/tmp/tm
pl0u0wuyh/work’, ‘-t’, ‘overlay’, ‘overlay’, ‘/tmp/tmpl0u0wuyh/mount’]’ returned non-zero exit status 32

Reading the other forum posts it looks like autoinstall is not really supported and cloud-init should be used. I am trying to confirm that autoinstall can be used (if so how to instantiate it) or that it cant be used.

In my environment I used snap to install MAAS and I have noticed that some things are different when using snap, so not adverse to reinstalling using apt if that provides more flexibility.

Hi @ericrife, thanks for reaching out with your question. I’m guessing that subiquity is required for the ephemeral install system, but if not–have you tried putting it under a user-data section (see here)?

Also, what version of Ubuntu are you trying to deploy? I’m also guessing you’re deploying Ubuntu Server?

What are you trying to achieve with autoinstall?

I am installing the standard 22.04.5 ubuntu image that comes with MAAS. The objective is to have more granular control of the system configuration. Defining networks, storage, late-commands etc. I have a more detailed autoinstall, but didnt include that in the issue. The minimum that I need for autoinstall to work should be what I pasted. The issue is that it cant even parse/start the autoinstall, so adding in additional sections still results in the same issue, subiquity crashes.

I did a little more research–unfortunately, subiquity won’t work with the standard images as the MAAS images don’t have the installation files that the ISO does

Let me try to upload the LIVE images and see if that might work better. Thanks for that information