Skip to content

fix(megaraid): remove cache policy prefixes on logical volume creation#85

Merged
ezekiel-alexrod merged 2 commits into
mainfrom
bugfix/megaraid-remove-cache-prefixes-lv-creation
Jul 17, 2026
Merged

fix(megaraid): remove cache policy prefixes on logical volume creation#85
ezekiel-alexrod merged 2 commits into
mainfrom
bugfix/megaraid-remove-cache-prefixes-lv-creation

Conversation

@ezekiel-alexrod

Copy link
Copy Markdown
Contributor

What

Fix logical volume creation on MegaRAID controllers: cache policy tokens
were emitted with the set-command prefixes (rdpolicy=, wrcache=,
iopolicy=), which the add vd grammar does not accept.

Why

storcli2 add vd takes cache policies as bare positional tokens, not as
key=value pairs. Passing the prefixed form made every creation fail:

$ storcli64 /c0 add vd type=raid0 drives=251:1 rdpolicy=nora wrcache=wb iopolicy=direct
syntax error, unexpected TOKEN_UNKNOWN, expecting $end

The key=value form is only valid on the set path (e.g. rdcache=,
wrcache=), which is left untouched.

What changed

megaraidCreateCacheFlags now returns the bare tokens from the mappers
(nora, wb, direct, ...) instead of prefixing them. The generated
command becomes:

/c0 add vd type=raid0 drives=251:1 nora wb direct

Testing

  • go build ./...
  • go test ./... (all green; updated TestMegaraidCreateCacheFlags
    expectation to the bare-token form)

@ezekiel-alexrod
ezekiel-alexrod requested a review from a team as a code owner July 17, 2026 12:59
@ezekiel-alexrod
ezekiel-alexrod merged commit 5d5bcea into main Jul 17, 2026
8 checks passed
@ezekiel-alexrod
ezekiel-alexrod deleted the bugfix/megaraid-remove-cache-prefixes-lv-creation branch July 17, 2026 13:13
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.

2 participants