Skip to content

feat(storage): a Pool tab in the Storage manager — pool, drives, plan → preview → apply - #69

Draft
ppenguin wants to merge 8 commits into
ReCasaOS:mainfrom
ppenguin:feat/storage-pools
Draft

ppenguin wants to merge 8 commits into
ReCasaOS:mainfrom
ppenguin:feat/storage-pools

Conversation

@ppenguin

Copy link
Copy Markdown
Contributor

Draft — under test on ReCasaNix; out of draft once tested on hardware.

Storage manager: a Pool tab for a backend-neutral storage layer (/v2/storage, contract: ReCasaOS/CasaOS-LocalStorage api/storage/openapi.yaml, ReCasaOS/CasaOS-LocalStorage#10).

  • shown only when GET /v2/storage answers; LocalStorage without it → panel unchanged
  • pool card: layout in words ("Mirror, 2 copies"), state tag (raid.js), capacity, "Survives N disks failing", the service's problem text
  • members: Replace / Take out (offered per the pool's verbs)
  • pool: Add a disk, Change protection, Restore protection, Check now / Stop the check, Mount with a disk missing
  • drives with their role: blank → Add to the pool / Create a pool; holds other data → Wipe; system / in use → nothing
  • StoragePlan dialog, one for every action:
    • asks only what the action needs: disks, member, layout; for a new pool, per-layout capacity, preselects the most protective possible
    • preview = the service's plan: summary, space and protection before → after, disks erased, steps; exact commands behind "Show the commands"
    • typed confirmation when the plan asks one (disks erased: their names; less protection: the pool's name)
    • refusals (409) shown as text; stale plan / expired → back to choosing
  • refreshes every 3 s while the pool works (rebuild, conversion, check); when done, the whole panel
  • strings: en_US, fr_FR (service texts: English)
  • specs: pools.spec.js (helpers, language files), StoragePlan.spec.js (create flow, refusal escaping, no-choice verbs, stale apply); full suite + eslint green

Tested end to end on ReCasaNix (real VM, gateway, browser): Pool tab on a degraded mirror, "Check now" → preview → Apply → started.

… → preview → apply

- shown only where the storage service answers GET /v2/storage (backend-neutral storage layer:
  one pool, btrfs or md underneath); an upstream LocalStorage: unchanged
- pool card: layout in words, state tag (raid.js), capacity, failures survived, members with
  Replace / Take out; Add a disk, Change protection, Check now / Stop, Mount with a disk missing
- drives with their role (blank, in the pool, holds other data, in use, system): Add, Wipe
- StoragePlan: what the action asks (disks, member, layout with capacity per option) → the
  service's plan (summary, space and protection before → after, disks erased, steps, commands)
  → typed confirmation → apply; refusals shown as text; stale plan → choose again
- looks again every 3 s while the pool works (rebuild, conversion, check)
- en_US, fr_FR; specs: pools.spec.js, StoragePlan.spec.js
…words

- data not in the pool's layout (written while a disk was missing): the service says so
  (problem) and offers restore-layout
# Conflicts:
#	src/assets/lang/en_US.json
#	src/assets/lang/fr_FR.json
#	src/components/Storage/StorageManagerPanel.vue
…alStorage#10)

- a card per pool; another pool offered only by the box's verbs (create-pool)
- intents name their pool (id)
- stripe: 'Mirror, 2 copies, striped' / 'No protection, striped'
- Delete the pool (red, typed confirmation from the plan)
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