From: Pedro Gonzalez Gomez Date: Tue, 1 Apr 2025 20:04:16 +0000 (+0200) Subject: mgr/dashboard: add enhancements for pool rulest X-Git-Tag: testing/wip-vshankar-testing-20250407.170244-debug~39^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e9d40c30038ff208e7f88234977ba73c292f39c9;p=ceph-ci.git mgr/dashboard: add enhancements for pool rulest On EC pool: - Use host count instead of device count for host crush-failure-domain - Host warning for k+m+1 On replicated: - Set 'All devices' as default Fixes: https://tracker.ceph.com/issues/70764 Signed-off-by: Pedro Gonzalez Gomez --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.spec.ts index 2b8c9e5cfe5..598a0bab175 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.spec.ts @@ -139,6 +139,7 @@ describe('CrushRuleFormComponent', () => { }); it('should select all values automatically by selecting "ssd-host" as root', () => { + formHelper.setValue('device_class', 'ssd', true); assert.valuesOnRootChange('ssd-host', 'osd', 'ssd'); }); @@ -149,7 +150,9 @@ describe('CrushRuleFormComponent', () => { it('should override automatic selections', () => { assert.formFieldValues(get.nodeByName('default'), 'osd-rack', ''); + formHelper.setValue('device_class', 'ssd', true); assert.valuesOnRootChange('ssd-host', 'osd', 'ssd'); + formHelper.setValue('device_class', '', true); assert.valuesOnRootChange('mix-host', 'osd-rack', ''); }); @@ -160,6 +163,7 @@ describe('CrushRuleFormComponent', () => { }); it('should preselect device by domain selection', () => { + formHelper.setValue('device_class', 'ssd', true); formHelper.setValue('failure_domain', 'osd', true); assert.formFieldValues(get.nodeByName('default'), 'osd', 'ssd'); }); @@ -203,6 +207,7 @@ describe('CrushRuleFormComponent', () => { }); it('creates a rule with all fields', () => { + formHelper.setValue('device_class', 'ssd', true); assert.valuesOnRootChange('ssd-host', 'osd', 'ssd'); assert.creation(Mocks.getCrushRuleConfig('ssd-host-rule', 'ssd-host', 'osd', 'ssd')); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.ts index 0afb2442735..f30b61ea5e5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.ts @@ -76,7 +76,8 @@ export class CrushRuleFormModalComponent extends CrushNodeSelectionClass impleme nodes, this.form.get('root'), this.form.get('failure_domain'), - this.form.get('device_class') + this.form.get('device_class'), + false ); this.names = names; }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.html index 58f46ae2304..0d74214cc51 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.html @@ -82,8 +82,11 @@ *ngIf="form.showError('k', frm, 'min')" i18n>Must be equal to or greater than 2. Chunks (k+m) have exceeded the available OSDs of {{deviceCount}}. + Chunks (k+m+1) have exceeded the available hosts of {{deviceCount}}. For an equal distribution k has to be a multiple of (k+m)/l. @@ -119,8 +122,11 @@ *ngIf="form.showError('m', frm, 'min')" i18n>Must be equal to or greater than 1. Chunks (k+m) have exceeded the available OSDs of {{deviceCount}}. + Chunks (k+m+1) have exceeded the available hosts of {{deviceCount}}. @@ -240,7 +246,8 @@