ops: teardown.sh fails on prevent_destroy and sweeps protected snapshots #610
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra#610
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
What
scripts/teardown.shrunstofu destroy, then sweeps leftover OpenStack objects, then runsopenstack-cost.py audit --expect-empty. The root, backup, data and LFS volumes and the monitoring root volume haveprevent_destroy = true(opentofu/compute.tofu:28,52,74,93,monitoring.tofu:126).Why
The script and its docs still claim destroy removes the volumes (script header,
compute.tofu:7-10,docs/runbook.md:2981). Underset -estep 1 aborts, so the sweep and the audit never run.Failing case
scripts/teardown.sh --yesfails at plan time with "Instance cannot be destroyed" and exits 1. Only--skip-tofugoes on. That path deletes volumes behind tofu's back and leaves state pointing at deleted IDs.sweep_volumesconsultsPROTECTED_VOLUME_NAMES. The snapshot, volume-backup and private-image sweeps (:146-148) delete everything.docs/runbook.mdmakespredrill-<volume>-<date>snapshots of the data, backup and LFS volumes as the rollback for a resize. A laterteardown.sh --yesdeletes them.Fix
Pick one model and apply it. Skip snapshots and backups whose volume maps to a protected name, using the lookup
sweep_volumesuses. Correct the three stale statements.Done when
teardown.sh --yeson a staging copy runs to the end and the audit passes.--yes.compute.tofucomment and runbook match the behaviour.Plan outline
prevent_destroyunder--include-data-volumes, or a non-fatal destroy that stops with a manual data-volume step.compute.tofu:7-10anddocs/runbook.md:2981.prevent_destroyblocks the run (liketofu-apply.sh --self-test).