Deploying custom MAAS images with Juju 3.2

Hey there,
Just thought I’d drop a small post here so it would be discoverable in the future.

What you need

First you must know the name property for the image in MAAS.

This would be the same as what you used when you added an image, for example (on the region controller):

maas derek boot-resources create name='custom/vanillapackerrocky8' title='vanilla packer Rocky 8 Custom' architecture='amd64/generic' base_image='centos/7' filetype='tgz' content@=packer-rocky8.tar.gz

The name is vanillapackerrocky8

How to list images in MAAS

Again on the Region Controller, run this to list the images:

maas derek boot-resources read

You will see a bunch of entries like this:

        "id": 801,
        "type": "Uploaded",
        "name": "vanillapackerrocky8",
        "architecture": "amd64/generic",
        "resource_uri": "/MAAS/api/2.0/boot-resources/801/",
        "subarches": "generic",
        "title": "vanilla packer Rocky 8 Custom"

Similarly, there is the name value to use.

Deploying the custom image

You must specify the name as an image-id property in the constraints AND specify a --base image that is compatible:

juju add-machine --base centos@7 --constraints "image-id=vanillapackerrocky8"

Hope this helps!