Allow passing cloud-init user-data on deployment and power-on via UI


#1

Currently it is only possible to specify cloudinit-userdata via API and not via the UI which hides this functionality from a user. It would be good to have this functionality exposed to provide similar experience to private and public cloud platforms (e.g. OpenStack or AWS allow you to specify userdata before deployment).

Various ways to provide userdata:

  1. enlistment time (via preseed files in /etc/maas);
  2. deployment time (api call);
    https://github.com/maas/maas/blob/2.4.2/src/maasserver/api/machines.py#L509-L515
  3. power-on (api call).
    https://github.com/maas/maas/blob/2.4.2/src/maasserver/api/nodes.py#L745-L751
maas maas machine deploy <system_id> user_data=<b64-encoded userdata>
maas maas machine power-on <system_id> user_data=<b64-encoded userdata>

Other community feedback from the old LP entry: https://bugs.launchpad.net/maas/+bug/1794080/comments/2


#2

I second this proposal. It could also include some useful examples.


#3

Hi igor, any examples will be highly appreciated! :slight_smile:


#4

I think having a drop down to specify user_data in the deployment dialog would be an excellent idea. We could also allow user_data to be stored in MAAS to make it easy to do multiple deployments without having to reupload it.


#5

+1 on that, we already had several requests from the customers asking for that feature to let them have full control over node deployment flow without referring to CLI and/or API queries.

From my perspective, I can see the following options:

  1. (quick-fix) Just add an input somewhere around “Deploy” dialog to supply arbitrary user_data (as a shellscript)
  2. (more nicer) Add a possibility to upload custom user-data scripts and let user choose from dropdown, if he wants to apply one
  3. (the cherry on the cake) Add a possibility to select user-data scripts from the above list as a default for the whole resource pool/rack controller/for the whole MAAS-controlled nodes/whatever else.