I created two profiles that have both have cloud-init.user-data sections. When launching a new instance with both profiles, only one is applied. I assume that it is not supported to have more than one profile with cloud-init sections. Is that correct? Thanks in advance ![]()
Keys override the ones previously defined. They are applied in profile declaration order, then your instance-specific ones take priority.
I agree that it would be desirable to add some kind of inheritance, but it leads to maintainability issues (hard to understand the behavior of an instance, and if we start implementing inheritance, then people could ask for it to be extended to other keys, which can cause plenty of other problems depending on said keys).
Thanks for your prompt answer! Is cloud-init run again if a profile is added to an existing instance?
Cloud-init is only run once at the first start of the instance, see How to use cloud-init - Incus documentation
You can use cloud-init.vendor-data in addition to cloud-init.user-data. See this.