Deploying custom Ubuntu Images on machines added to juju model

Hi,

I have been trying to deploy machines using custom ubuntu image that I have created using the guide: https://maas.io/docs/deb/2.8/cli/creating-a-custom-ubuntu-image

$ maas admin boot-resources read
<snipped>

    {
        "id": 20,
        "type": "Uploaded",
        "name": "focal-custom",
        "architecture": "amd64/generic",
        "resource_uri": "/MAAS/api/2.0/boot-resources/20/",
        "subarches": "generic",
        "title": "Ubuntu 20.04 FirmwareFix Image"
    }
]

The custom image gets uploaded as a TGZ file:

$ pwd
/var/snap/maas/common/maas/boot-resources/current/custom/amd64/generic/focal-custom/uploaded
$ ls
root-tgz

I want to be able to use this custom ubuntu image to deploy machines.

Following this, I have been trying to upload this image to the Juju metadata server, so that I can add the image-metadata-url to configure the model to use this image.

$ tree
.
├── releases
│   └── focal-custom
│       ├── focal-custom.tgz
└── streams
    └── v1
        ├── com.ubuntu.cloud:released:download.json
        └── index.json

$ juju model-config image-metadata-url=https://metadata-server/custom
$ juju add-machine machine01.maas --series focal-custom
created machine 0

$ juju list-machines
Machine  State  DNS  Inst id  Series        AZ  Message
0        down        pending  focal-custom      unknown OS for series: "focal-custom"

Am I doing this incorrectly?

I’d be extremely grateful if someone has any hints/suggestions on how this can be achieved.

Here’s how the json files looks:

$ cat streams/v1/index.json
{
    "index": {
        "com.ubuntu.cloud:released:download": {
            "datatype": "image-downloads",
            "path": "streams/v1/com.ubuntu.cloud:released:download.json",
            "updated": "Tue, 19 Oct 2021 07:05:49 +0000",
            "products": [
                "com.ubuntu.cloud:server:focal-firmwarefix:amd64"
            ],
            "format": "products:1.0"
        }
    },
    "updated": "Tue, 19 Oct 2021 07:05:49 +0000",
    "format": "index:1.0"
}


$ sudo cat streams/v1/com.ubuntu.cloud:released:download.json
{
    "content_id": "com.ubuntu.cloud:released:download",
    "datatype": "image-downloads",
    "format": "products:1.0",
    "license": "http://www.canonical.com/intellectual-property-policy",
    "products": {
        "com.ubuntu.cloud:server:focal-firmwarefix:amd64": {
            "aliases": "focal-custom",
            "arch": "amd64",
            "version": "focal-custom",
            "release": "focal-custom",
            "os": "focal",
            "supported": true,
            "versions": {
                "focal-custom": {
                    "items": {
                        "tgz": {
                            "ftype": "tgz",
                            "md5": "5ee1863fd2bf28f8cf863561d22ca758",
                            "path": "releases/focal-custom/focal-custom.tgz",
                            "sha256": "c6584ecdffc8626a53b7639cdb84be6624fab50412cfb94467e970e4192a8638",
                            "size": 807364028
                        }
                    }
                }
            }
        }
    },
    "updated": "Tue, 19 Oct 2021 07:05:49 +0000"
}

Regards, Sana

My understanding of how this works is that you’ll need to set the metadata to call that image “focal” not “focal-custom” as “focal-custom” is not going to be a supported series of publicly published charms, nor is it recognized as a version of the Ubuntu operating system.