Can you restore a snapshot on a running container?

is it possible to restore a snapshot of a container that is running, or should you stop the container first and restart if afterwards? like …
lxc stop [container]
lxc restore [container] [sn-name]
lxc start [container]

testing this I think the answer is yes and no

yes - because you won’t be destroying your container when restoring a snapshot while it’s running

no - because the lxc restore command seems practically stops the container for you, restores the snapshot and starts the container again afterwards (so it’s impossible to restore while container is actually still running)

so lxc restore seems to be dummy-save

1 Like

Right, we can’t switch the filesystem under a running container without getting a lot of failures and data corruption.

The one thing we support (so long as CRIU works) is rolling back container state too but using a stateful snapshot. In that case, the container won’t be restarted so much as all the tasks that were running at the time of the snapshot will be restored too.