How to keep any settings from our customization image after it is uploaded and deployed to a device via MAAS 3.4.1(snap)?

[Env]
$ snap list maas
Name Version Rev Tracking Publisher Notes
maas 3.4.1-14343-g.a552d2522 34087 3.4/stable canonical✓

[Definition]
The customization image: it’s a preinstallation format that includes partition layout, EFI boot assets, kernel, and the rootfs.

[Full question]
How to deploy a customization preinstallation image to the x86 device and keep any settings from the image? Only some configurations to sync the status with the MAAS server can be added. Is it possible?

[Problems]

  • We try to import the image with ddxz type, but the deployment process (PXE boot) shows the shim signature error (secure-boot is enabled) or magic number error (secure-boot is disabled).

    • Looks like the image’s original boot assets are destroyed after the image is imported to the MAAS.
    • Could the image importing process keep the original boot assets and make Curtin just deploy them to the device?
  • We also try to only import our rootfs with txz type

    • The boot assets are deployed by curtin and boot up to rootfs correctly.

    • However, we found the rootfs forced to add some cloud-init configurations after the rootfs is imported to MAAS.

      • For example, we already land a specific kernel into the image, no need to install a generic kernel by cloud-init again.
      • Another example is we already configured a user account into the rootfs, but the account was destroyed by MAAS. Looks like the MAAS make system only can log in by SSH key.
    • Therefore, could we make MAAS skip to add any extra cloud-init configuration?
      Because we already put the necessary cloud-init configurations into our image.

Hi @laiderlai ,

just a pre-flight check: are you using packer-maas to build your own image?

Hi @r00ta ,

No, we use the ubuntu-image tool(GitHub - canonical/ubuntu-image: Official tool to build Ubuntu Images.) for building the preinstallation image.

We understood MaaS is suggested to use packer-maas for building the image.
But we think the images are built in the same preinstallation format, we may have a chance to make it be used for MAAS with some little changes. Is it possible to use boot assets from the image and skip cloud-init configurations from the MAAS?

Tks.

I would say not out of the box. Maybe you can achieve this by customizing the curtin installation, but I’m not 100% sure

Ah, thanks for your feedback.
I will try to customize /etc/maas/preseeds content with the deb version.
The snap version may enter some permission problems. Tks.

you might also want to try the curtin commands as briefly described here https://maas.io/docs/how-to-customise-machines