]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Add details to the modal which displays the `safe-to-destroy` result 47849/head
authorFrancesco Torchia <francesco.torchia@suse.com>
Fri, 26 Aug 2022 15:39:43 +0000 (17:39 +0200)
committerFrancesco Torchia <francesco.torchia@suse.com>
Fri, 16 Sep 2022 12:59:11 +0000 (14:59 +0200)
- Add warnings type information in the case of the OSDs are not safe to destroy
- Add info type information in the case of the OSDs are safe to destroy

Fixes: https://tracker.ceph.com/issues/37327
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts

index afec81d9d1971e2446d5b36768329ee7ae8ecc01..5322ddea887208ea8a1ac0c6c7c15cf63865fe01 100644 (file)
 <ng-template #criticalConfirmationTpl
              let-safeToPerform="safeToPerform"
              let-message="message"
+             let-active="active"
+             let-missingStats="missingStats"
+             let-storedPgs="storedPgs"
              let-actionDescription="actionDescription"
              let-osdIds="osdIds">
   <div *ngIf="!safeToPerform"
-       class="danger">
-    <cd-alert-panel type="warning"
-                    i18n>The {selection.hasSingleSelection, select, true {OSD is} other {OSDs are}} not safe to be
-      {{ actionDescription }}! {{ message }}</cd-alert-panel>
+       class="danger mb-3">
+    <cd-alert-panel type="warning">
+      <span i18n>
+        The {selection.hasSingleSelection, select, true {OSD is} other {OSDs are}} not safe to be
+        {{ actionDescription }}!
+      </span>
+      <br>
+      <ul class="mb-0 pl-4">
+        <li *ngIf="active.length > 0"
+             i18n>
+          {selection.hasSingleSelection, select, true {} other {{{ active | join }} : }}
+          Some PGs are currently mapped to
+          {active.length === 1, select, true {it} other {them}}.
+        </li>
+        <li *ngIf="missingStats.length > 0"
+             i18n>
+          {selection.hasSingleSelection, select, true {} other {{{ missingStats | join }} : }}
+          There are no reported stats and not all PGs are active and clean.
+        </li>
+        <li *ngIf="storedPgs.length > 0"
+             i18n>
+          {selection.hasSingleSelection, select, true {OSD} other {{{ storedPgs | join }} : OSDs }}
+          still store some PG data and not all PGs are active and clean.
+        </li>
+        <li *ngIf="message">
+          {{ message }}
+        </li>
+      </ul>
+    </cd-alert-panel>
+  </div>
+  <div *ngIf="safeToPerform"
+       class="danger mb-3">
+    <cd-alert-panel type="info">
+      <span i18n>
+        The {selection.hasSingleSelection, select, true {OSD is} other {OSDs are}}
+        safe to destroy without reducing data durability.
+      </span>
+    </cd-alert-panel>
   </div>
   <ng-container i18n><strong>OSD {{ osdIds | join }}</strong> will be
   <strong>{{ actionDescription }}</strong> if you proceed.</ng-container>
index 9f418e0e3426c065fc75b7ae0a4f235e3a20d73d..ec8268d8b040550cdd8e5182a7faa6ec560e5098 100644 (file)
@@ -580,6 +580,9 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
         bodyContext: {
           safeToPerform: result[checkKey],
           message: result.message,
+          active: result.active,
+          missingStats: result.missing_stats,
+          storedPgs: result.stored_pgs,
           actionDescription: templateItemDescription,
           osdIds: this.getSelectedOsdIds()
         },
index 10a0cf47f0887ed720af19d652f36d235f2e5b0c..34461bf6314930ba2b98b9e43ae3c02320055675 100644 (file)
@@ -165,6 +165,9 @@ export class OsdService {
 
   safeToDestroy(ids: string) {
     interface SafeToDestroyResponse {
+      active: number[];
+      missing_stats: number[];
+      stored_pgs: number[];
       is_safe_to_destroy: boolean;
       message?: string;
     }