Automatic snapshots, snap remove --purge proposal

pstolowski
upcoming

#1

With automatic snapshots feature landed and to be released with 2.39, snapd now creates a snapshot of the snap data and configuration automatically on snap remove and keeps it around for 31 days by default. It has been observed that because of that some snaps are now slow to remove if they create lots of data (one example is multipass snap, with 2GB+ of data).

While the feature can be disabled with snap set core snapshots.automatic.retention=no, it acts as a global flag. Therefore after a short discussion about the issue it has been proposed that remove command grows a new flag that disables automatic snapshot when removing the given snap only, e.g:

snap remove --purge myfatsnap

Any thoughs/suggestions about the new flag are welcome and if there is no disagreement, I’ll implement it soon.


Very bad, my user data was removed too!
#2

I support having a --purge flag, for exactly the case you described, removing multipass which generates gigabytes of data.


#3

Sounds reasonable to me and I can’t think of any downsides to having this flag. The name of the flag seems obvious and a good choice.


#4

Thanks for feddback! The tentative PR is here: https://github.com/snapcore/snapd/pull/6870


#5

Thanks for this, I was just about to ask for just such a thing. The snap remove now takes too long for my tastes due to it creating a snapshot for the data.