Host OS shutdown/restart = Graceful shutdown & restart of LXD containers?

When the Ubuntu host OS is shutdown and or rebooted are the LXD containers shut down or restarted gracefully as well?

I wanted to make sure that there isn’t something additional I need to configure to make sure that containers shutdown and reboot properly when shutting down or rebooting the host OS.

Yes, on shutdown of the host all containers are sent a shutdown signal to which they have 30s to respond by doing a clean shutdown of the container. After that, if the container is still running, it’ll be killed by LXD.

On startup, all containers which were running at the time the system was shut down will be started back up.

1 Like