I have created a new container for Prometheus and Grafana, following the instructions in the LXD documentation and setting a static IP and two forwards so I can access the UI’s from outside the host:
bhills@turlough:~$ lxc config device list metrics
eth0
grafananat
prometheusnat
All is working great; however, I have found that if I use LXD UI to update the container resources and set a memory limit, eth0 and grafananat settings are deleted and the container no longer starts. If I restore the settings and set the memory resources via the command line using limits.memory, the settings are not lost and the container starts.
This looks to be an issue with LXD UI, but I am fairly new to LXD and I’ve been unable to find any logs that can back this up. I am using the snap version of LXD (v 5.17) and have looked in the logs under the container directory /var/snap/lxd/common/lxd/logs/ and the container logs, but this shows nothing.
I can’t reproduce the problem with the information provided. I assume it might be due to a custom network configuration, that the UI does not handle correctly yet. Can you please post the output of the command below?
lxc config device show metrics
This shows the full device configuration for that instance, which I hope will give a clue as to what went wrong on the config update from the UI.
As for the logging question, I am not aware of a way that LXD is logging configuration changes on instances.
LXD UI not yet supporting custom network config makes a lot of sense. I’ll try and reproduce the issue with a new container - see if I can get it down to a specific set of steps.
@amugofjava thank you for providing more information and sorry for the inconvenience we caused for you. This was indeed a bug in handling custom devices in the UI. When reducing the devices from the html form for the api call, it would forget previous devices whenever a custom device is encountered. And the proxies in your config are custom devices. This PR will fix it. It should be part of the next LXD 5.18 release.