Skip to content

snapshot-all: skip volumes no instance is using - #104

Open
wmantly wants to merge 1 commit into
mainfrom
fix/snapshot-only-attached-volumes
Open

wmantly wants to merge 1 commit into
mainfrom
fix/snapshot-only-attached-volumes

Conversation

@wmantly

@wmantly wmantly commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

The daily snapshot-all timer snapshots every custom volume, including detached ones.

A volume left behind by a deleted tenant (or an old volume name) has no instance to attach to again, so each night's snapshot copies nothing forward and keeps the leftover alive — one full copy per night on the dir driver.

Found on the production host: five detached volumes (an old fleet-manager-data and four demo tenants), still receiving daily-20261114 snapshots days after the tenants were deleted. Together they had accumulated ~7 GB.

custom_volumes() now lists only volumes with a used_by:

  • an attached stopped instance is still snapshotted — its data matters;
  • a detached volume is not — nothing will mount it, and its snapshots only cost space.

bash -n clean. No test: the script has none, and the filter is a one-line JSON predicate. The paired change on the fleet-manager side (purge a demo's volume when its tenant is deleted, opsavor/fleet-manager#255) stops the volumes being created in the first place.

The daily timer snapshotted every custom volume, including detached ones: a volume
left behind by a deleted tenant (or an old volume name) has no instance to attach it
to ever again, so each night's snapshot copied nothing forward and kept the leftover
alive, one full copy per night on the dir driver.

The production host had five such volumes (an old fleet-manager-data and four demo
tenants), still receiving daily snapshots 2026-11-14 for tenants deleted days before.

`custom_volumes` now lists only volumes with a `used_by`, so an attached but stopped
instance is still snapshotted (its data matters) and a detached one is not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant