Skip to content

mgr/dashboard: Add stretch EC pool create command args to dashboard - #65

Merged
kamoltat merged 1 commit into
aainscow:stretchy-Cfrom
Ericmzhang:wip-stretchy-c-dashboard
Oct 16, 2026
Merged

kamoltat merged 1 commit into
aainscow:stretchy-Cfrom
Ericmzhang:wip-stretchy-c-dashboard

Conversation

@Ericmzhang

@Ericmzhang Ericmzhang commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR adds support for multi-zone and stretch pool creation parameters in the Ceph Dashboard, bringing UI and controller pool creation into parity with the Ceph monitor (osd pool create / PoolCreateParams).

Key Changes

  1. Dashboard Backend Controller (controllers/pool.py):

    • Added support for new osd pool create parameters: num_zones, replica, min_size, k, m, root, osd_failure_domain, zone_failure_domain, and crush_device_class (mapped to class).
    • Routed parameters to CephService.send_command('mon', 'osd pool create', ...).
  2. Dashboard UI Form Component & Template (pool-form):

    • Multi-Zone Configuration: Added input field for num_zones.
    • Replicated Pool Sizing:
      • Dynamically swaps between "Replicated size" (size) for single-zone pools and "Replicas per zone" (replica) for multi-zone pools (num_zones > 1).
      • Disables explicit size on multi-zone pools to allow the monitor to calculate total size .
      • Added optional min_size (minimum replica size) input with validation ensuring.
    • Stretch Erasure Coded Pools (k and m):
      • Added inputs for data chunks (k) and coding chunks (m).
      • Enforces mutual requirement (k and m must both be set or both omitted).
      • Enforces stretch EC divisibility constraint: (k + m) \pmod{\text{num_zones}} == 0.
      • When k and m are specified, omits pre-existing EC profile selection so the monitor auto-creates the profile.
    • CRUSH Parameters:
      • Added dropdowns for CRUSH root (root), Device class (class), OSD failure domain (osd_failure_domain), and Zone failure domain (zone_failure_domain).
      • Displayed conditionally for multi-zone pools (num_zones > 1).
      • Added cross-field validation preventing CRUSH parameters from being specified together with an explicit CRUSH ruleset.
      • Added -- Default (cluster chooses) -- option for CRUSH rule dropdown.
  3. Tests:

    • Added Python unit tests in test_pool.py covering multi-zone, replica, min_size, and CRUSH parameter argument handling.
    • Updated Angular Jasmine/Jest specs in pool-form.component.spec.ts covering validation rules, multi-zone field toggling, min_size checks, and payload generation.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@Ericmzhang
Ericmzhang force-pushed the wip-stretchy-c-dashboard branch 2 times, most recently from 9c65cdc to a724a9d Compare October 14, 2026 00:38
@kamoltat
kamoltat self-requested a review October 14, 2026 13:35

@kamoltat kamoltat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

1 comment I used AI to analyze the other two are more of NIT stuff.

Comment on lines +81 to +94
def test_creation_replicated_sends_no_ec_or_zone_params(self, send_command):
kwargs = self._create_pool(send_command, {
'pool': 'rep-pool',
'pool_type': 'replicated',
'pg_num': 32,
'size': 3
})
self.assertEqual(kwargs['pool'], 'rep-pool')
self.assertEqual(kwargs['pg_num'], 32)
# None values are dropped by CephService.send_command, so the mon applies its defaults
for name in ['rule', 'num_zones', 'replica', 'min_size', 'root', 'k', 'm',
'osd_failure_domain', 'zone_failure_domain', 'erasure_code_profile']:
self.assertIsNone(kwargs.get(name), name)
self.assertNotIn('class', kwargs)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we add a test for num_zones = 3? and expect it to fail and throw an output saying something along the lines of "num_zones = 3" currently not supported

@Ericmzhang
Ericmzhang force-pushed the wip-stretchy-c-dashboard branch from a724a9d to a22fc99 Compare October 14, 2026 20:12
Comment on lines +213 to +215
if num_zones is not None and int(num_zones) != 2:
raise DashboardException(
msg='num_zones = {} is not supported; only num_zones = 2 is currently supported'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

wait does this mean that num_zones = 1 is also not supported?
I was thinking num_zones = 1 should be idempotent

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for catching that. num_zones = 1 should be allowed.

@kamoltat kamoltat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

second round of review, thanks for addressing comments from the first round,
just left a question regarding whether num_zones = 1 should be allow in pool set

Add dashboard inputs for num_zones, k, m, CRUSH params (osd_failure_domain,
zone_failure_domain, root, class), replica, min_size.
@Ericmzhang
Ericmzhang force-pushed the wip-stretchy-c-dashboard branch from a22fc99 to 8cfaba4 Compare October 16, 2026 15:26

@kamoltat kamoltat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@kamoltat
kamoltat merged commit 16427d4 into aainscow:stretchy-C Oct 16, 2026
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