I have a few different scenarios where I am applying a custom profile to a juju deployed LXD container. This ranges form charms that I'm waiting to add profile support to the charm to very custom-to-me use cases where I need to apply settings which don't belong in the charm and juju doesn't provide a way to do via tooling.
What I'm seeing is that *sometimes* profiles are removed from LXD containers after a host reboot. The very fact that this only happens part of the time makes me think it is unintended, and I originally thought it was a LXD bug. In fact, I've created a bug against LXD which has been evaluated and determined to not be related to LXD leaving juju as the most likely source of this issue.
The Github bug is found here: https://github.com/lxc/lxd/issues/6139
I'm happy to post more information here, but this bug report is very definitive and copy/pasting it here doesn't seem to add a lot of value.
If you have any issue reproducing this, I've also triggered this in other environments. Specifcally I have a K8s in LXD setup running right now on top of OpenStack that triggered this on 4 out of 8 containers on the first host reboot. I can provide that if it helps, but in my experience applying a custom profile to a few containers which are juju deployed, and then rebooting the host is a pretty easy way to trigger this.
Of course, I should have provided some version numbers.
While some versions are explicitly listed in the github bug, I'm reproducing this right now with juju 2.6.8 running on top of OpenStack.