public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: osd: warn if removal could be problematic
@ 2022-02-04  9:50 Aaron Lauterer
  2022-02-04 16:42 ` Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Lauterer @ 2022-02-04  9:50 UTC (permalink / raw)
  To: pve-devel

If an OSD is removed during the wrong conditions, it could lead to
blocked IO or worst case data loss.

Check against global flags that limit the capabilities of Ceph to heal
itself (norebalance, norecover, noout) and if there are degraded
objects.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---

Those are the things to check for that came to mind. If someone thinks
that we should definitely check for more, I am happy to send a v2.

I am also open to suggestions on how to phrase the warnings better.

I opted for separate hints to be able to show detailed hints so the
users have an idea how to act on the warning and to keep the logic
behind them simple.

 www/manager6/ceph/OSD.js | 41 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index e126f8d0..7ab11b9e 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -178,6 +178,20 @@ Ext.define('PVE.CephRemoveOsd', {
 	    labelWidth: 130,
 	    fieldLabel: gettext('Cleanup Disks'),
 	},
+	{
+	    xtype: 'displayfield',
+	    name: 'osd-flag-hint',
+	    userCls: 'pmx-hint',
+	    value: gettext('Global flags that limit the self healing of Ceph are enabled.'),
+	    hidden: true,
+	},
+	{
+	    xtype: 'displayfield',
+	    name: 'degraded-objects-hint',
+	    userCls: 'pmx-hint',
+	    value: gettext('Objects are degraded. Consider waiting until the cluster is healthy.'),
+	    hidden: true,
+	},
     ],
     initComponent: function() {
         let me = this;
@@ -193,6 +207,33 @@ Ext.define('PVE.CephRemoveOsd', {
 
 	me.title = gettext('Destroy') + ': Ceph OSD osd.' + me.osdid.toString();
 
+	Proxmox.Utils.API2Request({
+	    url: `/cluster/ceph/flags`,
+	    method: 'GET',
+	    failure: response => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
+	    success: function({ result: { data } }) {
+		let flags = Array.from(
+		    data.filter(v => v.value),
+		    v => v.name,
+		).filter(v => ['norebalance', 'norecover', 'noout'].includes(v));
+
+		if (flags.length) {
+		    me.down('field[name=osd-flag-hint]').setHidden(false);
+		}
+	    },
+	});
+
+	Proxmox.Utils.API2Request({
+	    url: `/cluster/ceph/status`,
+	    method: 'GET',
+	    failure: response => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
+	    success: function({ result: { data } }) {
+		if (Object.keys(data.pgmap).includes('degraded_objects')) {
+		    me.down('field[name=degraded-objects-hint]').setHidden(false);
+		}
+	    },
+	});
+
         Ext.applyIf(me, {
 	    url: "/nodes/" + me.nodename + "/ceph/osd/" + me.osdid.toString(),
         });
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-04 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04  9:50 [pve-devel] [PATCH manager] ui: osd: warn if removal could be problematic Aaron Lauterer
2022-02-04 16:42 ` Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal