LXD/Incus automatic stateful stop of VM?

I have setup a VM with stateful stop enabled and can successfully run lxc stop --stateful vm.

Can I configure LXD to automatically do stateful stop when my laptop shuts down and stateful start when it boots again?

That’s interesting, I think there are a few things we could do to properly handle that:

  • Introduce a boot.host_shutdown_action option on the instance, defaulting to stop but also allowing for force-stop and stateful-stop.
  • Also add support for both force-stop and stateful-stop to cluster.evacuate.
  • Add a server config key to trigger an evacuation on host shutdown when clustered.

Can you file an issue at Issues · lxc/incus · GitHub ?