nspawn-vault-web v0.1.0-23
nspawn-vault-web v0.1.0-23
Adds a per-container snapshot-retention figure to the HostDetail table:
the current snapshot count, plus how many would remain after the next
GFS prune run.
Why
Prompted by a real question: is 40 stored snapshots for one container too
many? It wasn't — 12 of them were already due for the next nightly prune,
just not cleaned up yet since nspawn-vault-prune.timer only runs once a
day. There was no way to see that in the UI before this without SSHing in
and doing the same check by hand.
How it works
vault_zfs.snapshot_retention() shells out to the exact same gfs.py
that the real prune timer calls, rather than reimplementing its bucket
logic. That matters: the naive GH+GD+GW+GM+GY sum is not the right
number here, since a recent snapshot can satisfy several retention
buckets (hour/day/week/...) at once — the real algorithm has to run to
get a correct answer, not just add up the config values.
The new "Snapshots" column shows a single number when a container is
already at its target count, or current / retained with a tooltip when
there's a difference — e.g. 40 / 28 for a container that's due for
pruning at the next run.