Hello,
I have seen that you can create images using the exiting packer-maas repository: GitHub - canonical/packer-maas: Packer templates to create MAAS deployable images
However, should I want to make a completely custom image (of Rocky 9 for instance), using another tool like mkosi, is there anything stopping me from doing that? Can I just upload the raw image file to MAAS? Could I find premade images online and upload them with no changes?
Do I need to install anything inside the image except cloud-init to make MAAS functionality work? (e.g. I’ve read about something like ‘curtin’ - does that go in the image, or is that part of the PXE installer environment?),
Thanks!
Will.
Nothing stops you from using other methods to create your image, but there are some expectations that your image needs to fulfill in order to be deployed by Curtin (our installer):
- format: either a tgz of the root disk contents or a raw image. curtin will format, mount the disk and extract the tarball in case of the former, or just write (
dd
) the image to the disk for the later. raw image files should not have any kind of header.
- cloud-init: used for the initial configuration
- the
/curtin
dir: used by Curtin to identify the root partition
In some cases, you might need to write a Curtin hook to correctly install and configure your image. a hook is a python script that can customize part of the installation, often the bootloader and network setup.
Thank you very much! Should anything be in the /curtin
directory, or just empty in /
?
And is networking usually done with cloud-init, or do all your packer images have a hook to do the networking?
the /curtin
dir can be empty when you don’t need custom hooks.
MAAS tells Curtin to create a static cloud-init datasource (type MAAS) with all the host configuration, so it can boot without network. This works for most distros supported by cloud-init.