lima-vm / lima

Linux virtual machines, with a focus on running containers
https://lima-vm.io/
Apache License 2.0
15.37k stars 602 forks source link

cloud-init: unify `bootcmd` into `per-boot` script? #2719

Open AkihiroSuda opened 1 month ago

AkihiroSuda commented 1 month ago

https://github.com/lima-vm/lima/blob/01b80e7696be14c4c745b8227cb0f4a699ebc2b1/pkg/cidata/cidata.TEMPLATE.d/user-data#L42-L97

Is it possible to unify bootcmd into the /var/lib/cloud/scripts/per-boot scripts? (What are those differences?)

jandubois commented 1 month ago

(What are those differences?)

I think the main difference is that bootcmd is running much earlier in the boot sequence (as the cloud-init-local.service). I'm not sure when that is needed though.

afbjorklund commented 4 weeks ago

I'm not sure when that is needed though.

I think it originally came from this feature request:

jandubois commented 4 weeks ago

I think it originally came from this feature request:

Yes, but it was proposed as just something that might be useful, without an actual need for it:

Another nice to have feature is allowing Lima users to customize cloud init’s cloud-init-local.service behavior via bootCmds, which run very early in the boot process (more info here). Users can use this feature to disable unnecessary services via systemctl (or other means, depending on the OS), or run other arbitrary commands for other reasons.

It is totally possible that nobody is using it at all.