Targeting curtin_userdata per OS release?

In this blog post on how to target curtin_userdata per-OS:

Customising MAAS installs (canonical.com)

…it says to look at /var/lib/boot-resources/current to figure out the elements for osystem/node_arch/node_subarch/release. However, I can’t find any boot-resources folder in any snap directory.

Where should I look instead?

Failing that, what {osystem}_{node_arch}_{node_subarch}_{release} should I be using to target:

  • Centos 7.9?
  • Rocky 8.8?
  • Rocky 9.3?

Thanks.

Hi @andrew-boatrocker,

What version of MAAS are using? Are you installing MAAS using snap or apt?

In the case of snap, you can find the preseed files in the following directory:
/snap/maas/current/etc/maas/preseeds/

Hi @javier-fs ,

I’m using MAAS 3.5 via snap on Rocky 9. On mine, the preseeds directory is at /var/snap/maas/current/preseeds/.

The problem is that there are only sample files in there which specify the OS:

$ ls /var/snap/maas/current/preseeds/
curtin_userdata_centos.sample  curtin_userdata_custom.sample  curtin_userdata_ol.sample  curtin_userdata.sample  curtin_userdata_windows.sample

I need to go further and figure out the file naming to use to differentiate between OS releases, for example between Rocky 8 and Rocky 9.

The only example I’ve seen that uses OS release numbers is in the blog post I linked to, which has “curtin_userdata_centos_amd64_generic_centos70”. However, that didn’t work for our Centos 7 installs, so I’m not sure what went wrong there. For Rocky, I’m not sure whether to use “rocky” or “custom” for {osystem}. I’m not sure whether to use “rocky8” or “rocky80” or “rocky88” or “custom8” or “custom80” or “custom88” for {release}. I have no idea whether there are options for {node_subarch} other than “generic”.

The blog post says to look at the directory structure under the boot-resources folder, but that folder doesn’t exist anymore.

Basically, I’m hoping for some documentation for this feature so that I don’t have to spend all day trying random things and hoping one of them works.

You can take a look at the Template naming section.

You can get the information about the boot resource using the boot-resources/boot-resource API endpoint, or by using the CLI:

maas $PROFILE boot-resources read

Considering that, for example, one of our boot resources is:

...
    {
        "id": 14,
        "type": "Synced",
        "name": "centos/8",
        "architecture": "amd64/generic",
        "resource_uri": "/MAAS/api/2.0/boot-resources/14/",
        "last_deployed": null,
        "subarches": "generic"
    },
...

then:

osystem: centos (first part of the boot resource name)
release: 8 (second part of the boot resource name)
node_arch: amd64 (first part of the boot resource architecture)
node_subarch: generic (second part of the boot resource architecture)

and the preseed file name would be:

{prefix}_{os}_{node_arch}_{node_subarch}_{release}
curtin_userdata_centos_amd64_generic_8

That’s exactly what I was looking for, thanks!

Looking at our Rocky 9 image, what would be the osystem and release for this, since it doesn’t have a slash in the name field?

    {
        "id": 12,
        "type": "Uploaded",
        "name": "rocky9-base-v001",
        "architecture": "amd64/generic",
        "resource_uri": "/MAAS/api/2.0/boot-resources/12/",
        "last_deployed": null,
        "title": "Rocky 9 Base v001",
        "subarches": "generic",
        "base_image": "rhel/9"
    }

In that case, the boot resource does not contain any release information thus there is no need to use the full template. Using the 3rd point in Template naming as a name template is enough:

{prefix}_{os}_{node_arch}_{node_subarch}
curtin_userdata_rocky9-base-v001_amd64_generic

If you only have a boot resource with rocky9-base-v001 as the OS name, you could simply use:
curtin_userdata_rocky9-base-v001

Thanks, I’ll give that a try.

Turns out curtin_userdata_rocky9-base-v001 didn’t work. Instead, I found that if I looked for the word “extracting” in the UI logs for the machine, this log entry had the info I needed:

Node installation - 'curtin' acquiring and extracting image from
http://<rackip>:5248/images/<imagehash>/custom/amd64/generic/rocky9-base-v001/uploaded/root.tgz

Based on that, I created curtin_userdata_custom_amd64_generic_rocky9-base-v001, and it was successfully used.

Thanks for your reply.

I checked, and you are right. In the case of building your own base resource custom is used as the name of the operating system and the name is used for the release field.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.