Skip to content

feat(storcli2): logical volume drive add (expand) and remove#70

Open
g-carre wants to merge 2 commits into
feature/storcli2-lv-manager-create-deletefrom
feature/storcli2-lv-manager-pd-membership
Open

feat(storcli2): logical volume drive add (expand) and remove#70
g-carre wants to merge 2 commits into
feature/storcli2-lv-manager-create-deletefrom
feature/storcli2-lv-manager-pd-membership

Conversation

@g-carre

@g-carre g-carre commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Completes ports.LogicalVolumesManager on the storcli2/perccli2 manager (ARTESCA-17648). Stacked on #69.

storcli2 dropped storcli's start migrate command (per DESIGN.md, verified against the StorCLI2 User Guide and the official storcli-to-storcli2 command map), so the two drive-membership operations split:

  • AddPDsToLV — online capacity expansion via /cx/vx expand drives=e:s,.... The firmware preserves the RAID level; drives spanning multiple enclosures are rejected.
  • DeletePDsFromLV — returns ports.ErrFunctionNotSupportedByImplementation: there is no storcli2 replacement for start migrate option=remove.

Replaces the stale plain-text migrate/fail.json fixture (a unexpected TOKEN_MIGRATE syntax error proving start migrate no longer parses) with proper expand/{success,fail}.json fixtures, and updates the collection script and testdata README.

Testing

go build, go vet, gofmt, and the package test suite pass. New tests cover the expand happy path, command-failure, multi-enclosure rejection, and the unsupported-removal error.

Note: This PR targets feature/storcli2-lv-manager-create-delete (its base, #69), not main. The diff will narrow once #69 merges.

Issue: ARTESCA-17648

🤖 Generated with Claude Code

@g-carre g-carre requested a review from a team as a code owner June 25, 2026 09:11
@g-carre g-carre force-pushed the feature/storcli2-lv-manager-create-delete branch from e5ba890 to 063bd83 Compare June 30, 2026 09:26
@g-carre g-carre force-pushed the feature/storcli2-lv-manager-pd-membership branch from d468745 to e66400a Compare June 30, 2026 12:33
@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
  • collect_storcli2_testdata.sh:718 — The DESTRUCTIVE-skip echo message still references the deleted migrate/fail.json. Should be updated to expand/{success,fail}.json to match the renamed fixtures and the updated run_and_save call.

    Review by Claude Code

@g-carre g-carre force-pushed the feature/storcli2-lv-manager-create-delete branch from 063bd83 to 7de356c Compare June 30, 2026 13:26
@g-carre g-carre force-pushed the feature/storcli2-lv-manager-pd-membership branch from e66400a to 2c5ab13 Compare June 30, 2026 13:26
@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

LGTM — AddPDsToLV and DeletePDsFromLV are clean: error wrapping is consistent, the compile-time interface check is a good addition, tests cover the happy path, command failure, multi-enclosure rejection, and the unsupported-removal sentinel. Fixtures and collection script are updated correctly.

Review by Claude Code

@g-carre g-carre force-pushed the feature/storcli2-lv-manager-create-delete branch from 7de356c to ddc8be4 Compare June 30, 2026 14:38
@g-carre g-carre force-pushed the feature/storcli2-lv-manager-pd-membership branch from 2c5ab13 to 0c6c272 Compare June 30, 2026 14:39
"${C}/v1" start migrate type=raid0 option=add "drives=${FIRST_ENCLOSURE}:${INVALID_SLOT}"
"Expand VD (expected failure)" \
"${OUTPUT_DIR}/logicalvolumemanager/testdata/storcli2/expand/fail.json" \
"${C}/v1" expand "drives=${FIRST_ENCLOSURE}:${INVALID_SLOT}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The collection step here was updated from migrate to expand, but the DESTRUCTIVE=false skip-list echo at line 718 still references the deleted migrate/fail.json path. It should be updated to expand/{success,fail}.json to stay in sync.

Also, expand/success.json is listed in the README fixture table as a script-produced file, but no collection step produces it (it would need a second free drive in the sacrifice-VD workflow). Consider either adding a collection step or noting it as hand-crafted.

— Claude Code

@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
  • collect_storcli2_testdata.sh:361 / :718 — The collection step was updated from migrate to expand, but the DESTRUCTIVE=false skip-list echo at line 718 still references the deleted migrate/fail.json. Also, expand/success.json is listed in the README fixture table but is not collected by the script.

    The implementation code (AddPDsToLV, DeletePDsFromLV), interface compliance check, fixtures, and tests all look correct.

    Review by Claude Code

@g-carre g-carre force-pushed the feature/storcli2-lv-manager-create-delete branch from ddc8be4 to 13d1232 Compare June 30, 2026 15:31
@g-carre g-carre force-pushed the feature/storcli2-lv-manager-pd-membership branch from 0c6c272 to 2131206 Compare June 30, 2026 15:35
@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
  • collect_storcli2_testdata.sh:127 — mkdir still creates the migrate directory, but the collection command (line 360) now writes to expand/fail.json. The expand directory won't exist and the write will fail. Change to: mkdir -p "${OUTPUT_DIR}/logicalvolumemanager/testdata/storcli2/expand"
    - collect_storcli2_testdata.sh:718 — SAFE-mode skip message still references migrate/fail.json instead of expand/{success,fail}.json. Stale after the rename.

    The Go implementation and tests look correct — error wrapping, interface compliance, sentinel error for unsupported removal, and fixture coverage are all solid.

    Review by Claude Code

@g-carre g-carre force-pushed the feature/storcli2-lv-manager-create-delete branch from e2a38b2 to cae6f00 Compare June 30, 2026 16:35
g-carre added 2 commits June 30, 2026 18:35
Complete ports.LogicalVolumesManager on the storcli2/perccli2 manager:

- AddPDsToLV grows a volume through "expand drives=e:s,..." (online capacity
  expansion). storcli2 dropped "start migrate", so expansion is the only
  supported growth path; the firmware preserves the RAID level. Drives
  spanning multiple enclosures are rejected.
- DeletePDsFromLV returns ErrFunctionNotSupportedByImplementation: the
  storcli-to-storcli2 command map drops "start migrate" with no replacement
  for removing drives from a volume (see DESIGN.md).

Replace the stale plain-text migrate/fail.json fixture (captured with the
v1 grammar that storcli2 rejects) with proper expand/{success,fail}.json
fixtures, and update the collection script and testdata README accordingly.

Issue: ARTESCA-17648
revive's unused-receiver rule flagged the named 's' receiver, which the
not-supported stub never references.

Issue: ARTESCA-17648
@g-carre g-carre force-pushed the feature/storcli2-lv-manager-pd-membership branch from 2131206 to 70f0661 Compare June 30, 2026 16:37
@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
  • collect_storcli2_testdata.sh:718 — The "skipped" echo still references the deleted logicalvolumemanager/testdata/storcli2/migrate/fail.json. Should be updated to expand/fail.json (and optionally expand/success.json) to match the fixtures this PR introduces.

  • collect_storcli2_testdata.sh — The script collects expand/fail.json (line 360) but never collects expand/success.json, while the README table documents both expand/{success,fail}.json as script-produced fixtures. Either add a collection step for the success case (requires a free drive + existing VD simultaneously, which may be hard to arrange in the sacrifice workflow) or add a comment noting the success fixture is hand-crafted.

Review by Claude Code

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