From: Thomas Lamprecht Date: Fri, 17 Mar 2023 10:22:07 +0000 (+0100) Subject: fix #4571: ui: ceph: allow adding extra-ID for multiple MDS per node X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=48dcbd1e991bf33d0382ba01406032c74b806044;p=pve-manager-legacy.git fix #4571: ui: ceph: allow adding extra-ID for multiple MDS per node 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 --- diff --git a/www/manager6/ceph/ServiceList.js b/www/manager6/ceph/ServiceList.js index 8b51fe6a..76710146 100644 --- a/www/manager6/ceph/ServiceList.js +++ b/www/manager6/ceph/ServiceList.js @@ -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() {