]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: osd: send in/out cmd to currently used node
authorAaron Lauterer <a.lauterer@proxmox.com>
Wed, 2 Mar 2022 10:12:49 +0000 (11:12 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 3 Mar 2022 11:15:38 +0000 (12:15 +0100)
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@proxmox.com>
www/manager6/ceph/OSD.js

index e126f8d0a0ce1dedfc064c863979b3e2512376b7..78f226ffb87940c7e8591d5bb7ea39c1de851134 100644 (file)
@@ -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,