How to update user.network-config and re-run cloud-init to apply the new config?

Hi,

I found that the settings in user.network-config are only used during the 1st launch of the container. After that, if I edit the settings in user.network-config and restart the container, there will be no effect.

If I want to edit the settings in user.network-config, how can I re-run cloud-init to apply the new config?

Thanks.

You’d need to do:

  • lxc exec NAME – cloud-init clean
  • lxc config set NAME volatile.apply_template create
  • lxc restart NAME