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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-03-17 11:22:07 +01:00
parent de422b3e7e
commit 2d6c2886a7

View File

@ -1,25 +1,42 @@
Ext.define('PVE.CephCreateService', { Ext.define('PVE.CephCreateService', {
extend: 'Proxmox.window.Edit', extend: 'Proxmox.window.Edit',
mixins: ['Proxmox.Mixin.CBind'],
xtype: 'pveCephCreateService', xtype: 'pveCephCreateService',
showProgress: true,
setNode: function(nodename) {
let me = this;
me.nodename = nodename;
me.url = `/nodes/${nodename}/ceph/${me.type}/${nodename}`;
},
method: 'POST', method: 'POST',
isCreate: true, isCreate: true,
showProgress: true,
width: 450,
setNode: function(node) {
let me = this;
me.nodename = node;
me.updateUrl();
},
setExtraID: function(extraID) {
let me = this;
me.extraID = me.type === 'mds' ? `-${extraID}` : '';
me.updateUrl();
},
updateUrl: function() {
let me = this;
let extraID = me.extraID ?? '';
let node = me.nodename;
me.url = `/nodes/${node}/ceph/${me.type}/${node}${extraID}`;
},
defaults: {
labelWidth: 75,
},
items: [ items: [
{ {
xtype: 'pveNodeSelector', xtype: 'pveNodeSelector',
submitValue: false,
fieldLabel: gettext('Host'), fieldLabel: gettext('Host'),
selectCurNode: true, selectCurNode: true,
allowBlank: false, allowBlank: false,
submitValue: false,
listeners: { listeners: {
change: function(f, value) { change: function(f, value) {
let view = this.up('pveCephCreateService'); 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() { initComponent: function() {