physicaldrivegetter: tolerate predictive failure and unknown ssacli statuses#44
Closed
ezekiel-alexrod wants to merge 1 commit into
Closed
physicaldrivegetter: tolerate predictive failure and unknown ssacli statuses#44ezekiel-alexrod wants to merge 1 commit into
ezekiel-alexrod wants to merge 1 commit into
Conversation
…tatuses ssacli reports a small open set of "Status:" values, but the parser previously aborted the whole physical-drive inventory as soon as it saw anything outside of OK/Failed/Offline. In particular, a drive flagged "Predictive Failure" - which is still online and serving its array - caused the install to fail. - Map "Predictive Failure" to PDStatusUsed so SMART warnings no longer block the install while the drive is still operational. - Soft-fail unknown statuses (e.g. "Rebuilding", future labels) to PDStatusUnknown instead of returning an error, and surface the raw ssacli label via PhysicalDrive.Reason so callers can still react. - Extract the status lookup into parseSSACLIStatus + a package-level map for clarity, and cover both new paths with fixture-based tests. Refs: ARTESCA-17608 Signed-off-by: Alex Rodriguez <131964409+ezekiel-alexrod@users.noreply.github.com>
Contributor
Author
|
Superseded by #45 (branch renamed to drop the internal tracker reference from the name). |
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.
Summary
Predictive Failurestatus toPDStatusUsedso a drive that is still online and serving its array no longer aborts the install.Rebuilding, future labels) toPDStatusUnknowninstead of returning an error, and surface the raw label throughPhysicalDrive.Reason.ssacliStatusMap+parseSSACLIStatushelper.predictive_failure_detail.txt,unknown_status_detail.txt) covering both branches.Why
The previous parser returned
invalid status: <value>for anything outside ofOK/Failed/Offline. In practice this means a single SMART warning (Predictive Failure) — on a disk that is otherwise fully operational — was enough to break the whole physical-drive inventory and block the install.The set of statuses ssacli can emit is not fully documented and evolves with firmware/agent versions, so the parser also needs to be forward-compatible: unknown labels should degrade gracefully (visible as
Unknownwith the rawReasonpreserved) rather than take the inventory call down.Test plan
go test ./pkg/implementation/physicaldrivegetter/...passes, including the two new cases inTestSSACLIPhysicalDriveStatus.golangci-lint run) stays green (note the documented//nolint:gochecknoglobalson the new lookup map).Predictive Failuredrive: inventory completes and the drive shows up asUsedwithReason: "Predictive Failure".