]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: mgr/dashboard: Select no device by default in EC profile 59557/head
authorAfreen Misbah <afreen23.git@gmail.com>
Mon, 2 Sep 2024 09:22:34 +0000 (14:52 +0530)
committerAfreen Misbah <afreen23.git@gmail.com>
Wed, 11 Sep 2024 09:27:49 +0000 (14:57 +0530)
Fixes https://tracker.ceph.com/issues/67853

When EC pools are created with device class specified, the pools are created with just 1 PG and autoscaler does not work.
PG autoscaler not working on a cluster where pools have multiple overlapping roots is a known issue, and bug is raised for same :>

Issue documented already : https://docs.ceph.com/en/reef/rados/operations/placement-groups/#viewing-pg-scaling-recommendations

Also renames "let ceph decide" option to "All devices" in crush rule and ec profile component.
Updates unit tests for ec profile modal
Signed-off-by: Afreen Misbah <afreen23.git@gmail.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/crush-rule.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/erasure-code-profile.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/classes/crush.node.selection.class.ts

index b3c0089834026c93068aaaf15933b8e9b1ffaeb2..dd199e6ca0a12c684c0aee4ab2e265ef8c3bfaa9 100644 (file)
@@ -94,8 +94,6 @@
           <label for="device_class"
                  class="cd-col-form-label">
             <ng-container i18n>Device class</ng-container>
-            <cd-helper [html]="tooltips.device_class">
-            </cd-helper>
           </label>
           <div class="cd-col-form-input">
             <select class="form-select"
                     name="device_class"
                     formControlName="device_class">
               <option ngValue=""
-                      i18n>Let Ceph decide</option>
+                      i18n>All devices</option>
               <option *ngFor="let deviceClass of devices"
                       [ngValue]="deviceClass">
                 {{ deviceClass }}
               </option>
             </select>
+            <cd-help-text>
+              <span i18n>{{tooltips.device_class}}</span>
+            </cd-help-text>
           </div>
         </div>
       </div>
index 7888fa853e3dd0038086326451cd33ce7c11842f..58f46ae230450e53126e4e0aa88f8bc3794d7fda 100644 (file)
           <label for="crushDeviceClass"
                  class="cd-col-form-label">
             <ng-container i18n>Crush device class</ng-container>
-            <cd-helper [html]="tooltips.crushDeviceClass">
-            </cd-helper>
           </label>
           <div class="cd-col-form-input">
             <select class="form-select"
                     name="crushDeviceClass"
                     formControlName="crushDeviceClass">
               <option ngValue=""
-                      i18n>Let Ceph decide</option>
+                      i18n>All devices</option>
               <option *ngFor="let deviceClass of devices"
                       [ngValue]="deviceClass">
                 {{ deviceClass }}
               </option>
             </select>
+            <cd-help-text>
+              <span i18n>{{tooltips.crushDeviceClass}}</span>
+            </cd-help-text>
             <span class="form-text text-muted"
                   i18n>Available OSDs: {{deviceCount}}</span>
           </div>
index 7d0331dfe54cf1027d51d9aa43ef979ad9b202c3..db53e32509575b34c0c7578c2e664c18825e9767 100644 (file)
@@ -563,6 +563,7 @@ describe('ErasureCodeProfileFormModalComponent', () => {
         ecpChange('technique', 'cauchy');
         formHelper.setMultipleValues(ecp, true);
         formHelper.setValue('crushFailureDomain', 'osd', true);
+        formHelper.setValue('crushDeviceClass', 'ssd', true);
         submittedEcp['crush-failure-domain'] = 'osd';
         submittedEcp['crush-device-class'] = 'ssd';
         testCreation();
index 5982dfe24fb1f652e41c4149ba0d198a5dfe0bd5..1521ae83f1b20ca56deaa6ce4cf8604183e9d592 100644 (file)
@@ -383,7 +383,8 @@ export class ErasureCodeProfileFormModalComponent
             nodes,
             this.form.get('crushRoot'),
             this.form.get('crushFailureDomain'),
-            this.form.get('crushDeviceClass')
+            this.form.get('crushDeviceClass'),
+            false
           );
           this.plugins = plugins;
           this.names = names;
index e4e7bb6054045780c70039052b7ac61117464019..8354e90381bd6b3deb0288e8770aff6609cd6f88 100644 (file)
@@ -13,7 +13,7 @@ export class CrushRuleService {
     // Copied from /doc/rados/operations/crush-map.rst
     root: $localize`The name of the node under which data should be placed.`,
     failure_domain: $localize`The type of CRUSH nodes across which we should separate replicas.`,
-    device_class: $localize`The device class data should be placed on.`
+    device_class: $localize`The device class on which to place data.`
   };
 
   constructor(private http: HttpClient) {}
index 988a13de2a9369474de63ba25928454947f7ac8d..f61201e3ce3c291bf69a87c93cefc9e7e6385785 100644 (file)
@@ -91,8 +91,7 @@ export class ErasureCodeProfileService {
      defaults to 1. Using a value greater than one will cause a CRUSH MSR rule to be created.
       Must be specified if crush-num-failure-domains is specified.`,
 
-    crushDeviceClass: $localize`Restrict placement to devices of a specific class
-      (e.g., ssd or hdd), using the crush device class names in the CRUSH map.`,
+    crushDeviceClass: $localize`The device class on which to place data.`,
 
     directory: $localize`Set the directory name from which the erasure code plugin is loaded.`
   };
index 34cebbcc8773e4faddcc31778d47430a48e58678..ec8b05232886bbda0d2a0551de2354cb14307092 100644 (file)
@@ -19,6 +19,14 @@ export class CrushNodeSelectionClass {
   failureDomainKeys: string[] = [];
   devices: string[] = [];
   deviceCount = 0;
+  /**
+   * Handles manual or automatic update of device class.
+   *
+   * When set true, the device class form field is automatically
+   * updated with the first device in the list of devices.
+   * Otherwise, user manually selects a device class.
+   */
+  autoDeviceUpdate: boolean = true;
 
   static searchFailureDomains(
     nodes: CrushNode[],
@@ -120,8 +128,10 @@ export class CrushNodeSelectionClass {
     nodes: CrushNode[],
     rootControl: AbstractControl,
     failureControl: AbstractControl,
-    deviceControl: AbstractControl
+    deviceControl: AbstractControl,
+    autoDeviceUpdate: boolean = true
   ) {
+    this.autoDeviceUpdate = autoDeviceUpdate;
     this.nodes = nodes;
     this.idTree = CrushNodeSelectionClass.createIdTreeFromNodes(nodes);
     nodes.forEach((node) => {
@@ -208,7 +218,7 @@ export class CrushNodeSelectionClass {
       this.devices.length === 1
         ? this.devices[0]
         : this.getIncludedCustomValue(this.controls.device, this.devices);
-    this.silentSet(this.controls.device, device);
+    if (this.autoDeviceUpdate) this.silentSet(this.controls.device, device);
     this.onDeviceChange(device);
   }