From 0d6100bbf99ffa8da0e099343ede050f1cca509c Mon Sep 17 00:00:00 2001 From: Francesco Torchia Date: Fri, 26 Aug 2022 17:39:43 +0200 Subject: [PATCH] mgr/dashboard: Add details to the modal which displays the `safe-to-destroy` result - 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 --- .../osd/osd-list/osd-list.component.html | 45 +++++++++++++++++-- .../osd/osd-list/osd-list.component.ts | 3 ++ .../src/app/shared/api/osd.service.ts | 3 ++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html index afec81d9d19..5322ddea887 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html @@ -64,13 +64,50 @@
- The {selection.hasSingleSelection, select, true {OSD is} other {OSDs are}} not safe to be - {{ actionDescription }}! {{ message }} + class="danger mb-3"> + + + The {selection.hasSingleSelection, select, true {OSD is} other {OSDs are}} not safe to be + {{ actionDescription }}! + +
+
    +
  • + {selection.hasSingleSelection, select, true {} other {{{ active | join }} : }} + Some PGs are currently mapped to + {active.length === 1, select, true {it} other {them}}. +
  • +
  • + {selection.hasSingleSelection, select, true {} other {{{ missingStats | join }} : }} + There are no reported stats and not all PGs are active and clean. +
  • +
  • + {selection.hasSingleSelection, select, true {OSD} other {{{ storedPgs | join }} : OSDs }} + still store some PG data and not all PGs are active and clean. +
  • +
  • + {{ message }} +
  • +
+
+
+
+ + + The {selection.hasSingleSelection, select, true {OSD is} other {OSDs are}} + safe to destroy without reducing data durability. + +
OSD {{ osdIds | join }} will be {{ actionDescription }} if you proceed. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts index 9f418e0e342..ec8268d8b04 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts @@ -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() }, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts index 10a0cf47f08..34461bf6314 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts @@ -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; } -- 2.39.5