]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
fix #4571: ui: ceph: allow adding extra-ID for multiple MDS per node
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 17 Mar 2023 10:22:07 +0000 (11:22 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 17 Mar 2023 11:03:37 +0000 (12:03 +0100)
One MDS can only serve a single CephFS at a time and for redundancy
one wants to have standby's on other nodes.

But with multiple CephFS instances a single MDS per node might not be
enough, e.g., with three FS on a three-node cluster a failure of one
node would mean that on CephFS won't work anymore.

While the API and CLI allowed to set up multiple CephFS per node
already, the UI didn't. Address this by adding an `Extra ID` field
that will be suffixed to the base ID, which always contains the node
as that makes sorting and also associating services to their node
easier.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/ceph/ServiceList.js

index 8b51fe6a65c9fb6a6c23a4938e8f67ef5c22e849..767101465dfd92498b62884546e13889f073227d 100644 (file)
@@ -1,25 +1,42 @@
 Ext.define('PVE.CephCreateService', {
     extend: 'Proxmox.window.Edit',
+    mixins: ['Proxmox.Mixin.CBind'],
     xtype: 'pveCephCreateService',
 
+    method: 'POST',
+    isCreate: true,
     showProgress: true,
+    width: 450,
 
-    setNode: function(nodename) {
+    setNode: function(node) {
+       let me = this;
+       me.nodename = node;
+       me.updateUrl();
+    },
+    setExtraID: function(extraID) {
        let me = this;
-       me.nodename = nodename;
-       me.url = `/nodes/${nodename}/ceph/${me.type}/${nodename}`;
+       me.extraID = me.type === 'mds' ? `-${extraID}` : '';
+       me.updateUrl();
     },
+    updateUrl: function() {
+       let me = this;
 
-    method: 'POST',
-    isCreate: true,
+       let extraID = me.extraID ?? '';
+       let node = me.nodename;
 
+       me.url = `/nodes/${node}/ceph/${me.type}/${node}${extraID}`;
+    },
+
+    defaults: {
+       labelWidth: 75,
+    },
     items: [
        {
            xtype: 'pveNodeSelector',
-           submitValue: false,
            fieldLabel: gettext('Host'),
            selectCurNode: true,
            allowBlank: false,
+           submitValue: false,
            listeners: {
                change: function(f, value) {
                    let view = this.up('pveCephCreateService');
@@ -27,6 +44,37 @@ Ext.define('PVE.CephCreateService', {
                },
            },
        },
+       {
+           xtype: 'textfield',
+           fieldLabel: gettext('Extra ID'),
+           regex: /[a-zA-Z0-9]+/,
+           regexText: gettext('ID may only consist of alphanumeric characters'),
+           submitValue: false,
+           emptyText: Proxmox.Utils.NoneText,
+           cbind: {
+               disabled: get => get('type') !== 'mds',
+               hidden: get => get('type') !== 'mds',
+           },
+           listeners: {
+               change: function(f, value) {
+                   let view = this.up('pveCephCreateService');
+                   view.setExtraID(value);
+               },
+           },
+       },
+       {
+           xtype: 'component',
+           border: false,
+           padding: '5 2',
+           style: {
+               fontSize: '12px',
+           },
+           userCls: 'pmx-hint',
+           cbind: {
+               hidden: get => get('type') !== 'mds',
+           },
+           html: gettext('The Extra ID allows creating multiple MDS per node, which increases redundancy with more than one CephFS.'),
+       },
     ],
 
     initComponent: function() {