[pve-devel] [PATCH manager] ui: osd: send in/out cmd to currently used node

Aaron Lauterer a.lauterer at proxmox.com
Wed Mar 2 11:12:49 CET 2022


The in & out commands for OSDs are not node specific and can be run on
any node in the Ceph cluster. By sending them to the node currently used
to access the UI they can still be sent even if the node on which the
OSDs are located is down.

This helps in a disaster scenario where a node is down. By default Ceph
will mark a downed OSD as out after 10 minutes. This could be too long
in some situations. Running the CLI command to mark the OSD as out
earlier on one of the remaining nodes does work, but if the admin is not
used doing it this way, this adds stress, in a potentially already
stressful situation.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 www/manager6/ceph/OSD.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index e126f8d0..78f226ff 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -391,8 +391,13 @@ Ext.define('PVE.node.CephOsdTree', {
 	    let osdid = vm.get('osdid');
 
 	    let doRequest = function() {
+		let targetnode = vm.get('osdhost');
+		// cmds not node specific and need to work if the OSD node is down
+		if (['in', 'out'].includes(cmd)) {
+		    targetnode = vm.get('nodename');
+		}
 		Proxmox.Utils.API2Request({
-		    url: "/nodes/" + vm.get('osdhost') + "/ceph/osd/" + osdid + '/' + cmd,
+		    url: `/nodes/${targetnode}/ceph/osd/${osdid}/${cmd}`,
 		    waitMsgTarget: me.getView(),
 		    method: 'POST',
 		    params: params,
-- 
2.30.2






More information about the pve-devel mailing list