How to apply multiple profiles containing cloud-config sections

Hi,

I’m trying to launch a container using multiple LXD profiles, where each profile contains a different cloud-config section.

When I do this, it seems that only the cloud-config data from the last profile applied takes effect. Is there a way to merge the cloud-init configurations from all profiles so they can be applied simultaneously at launch?

Thanks for your help!

Hi @ahresse,

Unfortunately not. Since each cloud init configuration is stored in a single key, each successive profile overrides the entire contents of that config key (and finally any configuration on the instance will override inherited profile configurations).

One exception to this is ssh keys (see https://documentation.ubuntu.com/lxd/latest/reference/instance_options/#instance-cloud-init:cloud-init.ssh-keys.KEYNAME) which we do merge into the cloud init config. Merging these configurations was quite complex, so it’s unlikely that we would allow merging arbitrary cloud init data in the future.

That said, feel free to open a feature request here and we will consider the feasibility :slight_smile:

Thanks, Mark.

Thank you for your answer.

Good to know about this SSH key way of doing. This is actually solving one of my profile which was dedicated to ssh.

Another profile is about GPG public keys import (and other setup to enable GPG tunnel signing through ssh). I imagine this doesn’t drift away much from SSH key import and it would be great to have it as a new feature. I will open a feature request once everything is more clear for me.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.