fix(cleanup): preserve attached block devices - #295
Draft
Q-Dub wants to merge 17 commits into
Draft
Conversation
lauri-amd
previously approved these changes
Aug 7, 2026
Remove the legacy disk hot-removal sweep so cleanup cannot detach virtio-SCSI cloud volumes after wiping them. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve canonical block-device identities, protect system dependency chains, strictly parse Bloom fstab records, and compare configured storage with live state before destructive cleanup. Co-authored-by: Cursor <cursoragent@cursor.com>
Guard every wipe against protected and mounted device trees, restrict fstab mutations to validated entries, preserve untagged Rancher storage, revalidate premounted sources, and make Longhorn iSCSI parsing field-position independent. Add regression coverage for strict tags, root-device rejection, explicit empty configs, and parser edge cases. Co-authored-by: Cursor <cursoragent@cursor.com>
Add cleanup --preflight-only, fail on unreadable configs, lock resolved disk scope before confirmation, and rerun validation immediately before both standalone cleanup and --destroy-data teardown. Co-authored-by: Cursor <cursoragent@cursor.com>
Describe preflight-only usage, config/fstab/live-state checks, protected device chains, strict Rancher ownership, repeated validation, and the corrected wipe-and-reformat cleanup behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
Q-Dub
force-pushed
the
EAI-7797_virtio_scsi_disk_detach
branch
from
August 10, 2026 05:36
8edbe23 to
89ec209
Compare
Stop the preview from independently adding live legacy Rancher mounts after preflight, and explicitly report when no strictly managed storage will be wiped. Co-authored-by: Cursor <cursoragent@cursor.com>
Allow bloom.yaml RANCHER_DISK to authorize untagged /var/lib/rancher mounts when live and fstab device identities match, while configless cleanup still requires strict Bloom fstab tags. Co-authored-by: Cursor <cursoragent@cursor.com>
Point configless preflight at rerunning cleanup with an explicit RANCHER_DISK entry instead of implying only manual fstab tagging works. Co-authored-by: Cursor <cursoragent@cursor.com>
Detect when CLUSTER_DISKS points at /var/lib/rancher storage and suggest moving the device to RANCHER_DISK, with generic guidance when no specific misconfiguration is found. Co-authored-by: Cursor <cursoragent@cursor.com>
Validate CLUSTER_DISKS and RANCHER_DISK against protected root, boot, swap, and other critical mounts before fstab agreement checks so stale configs surface a clear safety error with remediation hints. Co-authored-by: Cursor <cursoragent@cursor.com>
Use exact findmnt mount points instead of path targets so directories like /srv on root are ignored, and accumulate mount reasons so whole-disk errors list /, /boot, and /boot/efi instead of a misleading last entry. Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify generic CLUSTER_DISKS remediation covers both Bloom fstab tags, including rancher-disk for RANCHER_DISK entries. Co-authored-by: Cursor <cursoragent@cursor.com>
When a Bloom tag is used on the wrong mount point, especially # managed by cluster-bloom on /var/lib/rancher, preflight now explains the expected comment format for each disk role. Co-authored-by: Cursor <cursoragent@cursor.com>
Move cleanup fstab snapshots out of /etc into /var/backups/cluster-bloom/fstab and retain only the five newest copies. Co-authored-by: Cursor <cursoragent@cursor.com>
Align deployment validation with cleanup by allowing full /dev/disk/by-id aliases for CLUSTER_DISKS and RANCHER_DISK while rejecting bare aliases and path traversal. Co-authored-by: Cursor <cursoragent@cursor.com>
Use short Longhorn disk names instead of encoded device paths and add regression coverage for stable by-id devices. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove the legacy disk hot-removal sweep so cleanup cannot detach virtio-SCSI cloud volumes after wiping them.