Serve own cloud-Init files to deployed machines from MAAS Metadata server

Hi,

we would like to interface the cloud-init connection between an already deployed / post-deployed machine and the MAAS metadata server. Is this possible somehow at this moment?

For example, think of a usecase where a machine reboots into the installed OS and then fetches fresh cloud-init files (e.g. user-data and meta-data) from the MAAS metadata server in order to modify the already installed OS conveniently using cloud-init instead of e.g. Ansible or bash scripts.

If I understand correctly, currently (as of 3.4), a deployed machine at some point after reboot has it’s own cloud-init client correspond to a MAAS metadata-server for cloud-init related conversation according to DataSourceMAAS.py. (see https://maas.io/docs/about-deploying-machines, or more specifically the deployment flowchart.

We would like to interface here, e.g. place our own new cloud-init files for the client to fetch them.

(I am aware that another option is to change the cloud-init source specifications/addresses after deployment and run my own cloud-init server)

Would the pre-seed cloud init feature work for you?

That feature is not suitable for us, as it only allows interfacing the cloud-init connection/relationship before deployment, not after deployment.

Ideally in the UI there would be text input fields somewhere in the machine configuration UI (like it is currently at /MAAS/r/machine/{system_id}/configuration with the fields notes etc.), where you can input both user-data and meta-data and which are stored by MAAS internally and served perpetually by the MAAS’ Metadata server at their respective enpoints. The cloud-init client on the machine only reacts to changed user-data if the instance-id field in meta-data is changed, thus they can be served perpetually with the current contents.

Such a feature would ofc also be great to have in the CLI, where you could e.g. run:

maas $PROFILE machine cloud-init $SYSTEM_ID user_data=<base-64-encoded-script> meta_data=<base-64-encoded-script>

and then have the MAAS Metadata Server serve user-data and meta-data for the respective system id.

Thanks for your feedback, I’m marking this as a feature request