From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 7C2B11FF0B2 for ; Sun, 22 Nov 2026 02:28:09 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 962FC216AE; Sun, 22 Nov 2026 02:26:59 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v3 manager 15/18] ui: node san: list NVMe over Fabrics controllers Date: Sun, 22 Nov 2026 02:25:52 +0100 Message-ID: <20261122012605.1848824-16-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261122012605.1848824-1-t.lamprecht@proxmox.com> References: <20261122012605.1848824-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795310772348 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.146 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: LTH73JDYYPAYUYJJ5CGST6AE6AXIZIXY X-Message-ID-Hash: LTH73JDYYPAYUYJJ5CGST6AE6AXIZIXY X-MailFrom: t.lamprecht@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add a view below Node > SAN with the controllers of a node, one per connected portal, with their transport, state and storage, and the host NQN of the node. A controller can be disconnected there, for example after its portal was removed from the storage, which the node refuses for the last usable path of a namespace in use. The controllers come from sysfs, so the view lists them also without nvme-cli, which only Disconnect needs. Signed-off-by: Thomas Lamprecht --- www/manager6/Makefile | 1 + www/manager6/SANUtils.js | 5 + www/manager6/Utils.js | 1 + www/manager6/node/Config.js | 9 +- www/manager6/node/NVMeOFControllers.js | 152 +++++++++++++++++++++++++ 5 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 www/manager6/node/NVMeOFControllers.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index f2fc80279..f3591e1c8 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -253,6 +253,7 @@ JSSRC= \ node/ISCSITargets.js \ node/LVM.js \ node/LVMThin.js \ + node/NVMeOFControllers.js \ node/SANLuns.js \ node/StatusView.js \ node/Subscription.js \ diff --git a/www/manager6/SANUtils.js b/www/manager6/SANUtils.js index d28285d22..abff7f458 100644 --- a/www/manager6/SANUtils.js +++ b/www/manager6/SANUtils.js @@ -132,6 +132,11 @@ Ext.define('PVE.SANUtils', { 'logged-in': ['check-circle good', gettext('Connected')], recovering: ['exclamation-circle warning', gettext('Reconnecting')], 'not-connected': ['times-circle faded', gettext('Not connected')], + live: ['check-circle good', gettext('Connected')], + connecting: ['exclamation-circle warning', gettext('Reconnecting')], + resetting: ['exclamation-circle warning', gettext('Reconnecting')], + deleting: ['times-circle faded', gettext('Disconnecting')], + 'deleting (no IO)': ['times-circle faded', gettext('Disconnecting')], }[state]; let [icon, label] = display ?? ['question-circle faded', state]; return ` ${Ext.htmlEncode(text ?? label)}`; diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index d508d0469..fc3667f51 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -2276,6 +2276,7 @@ Ext.define('PVE.Utils', { lvmthinremove: ['Thinpool', gettext('Remove')], migrateall: ['', gettext('Bulk migrate VMs and Containers')], move_volume: ['CT', gettext('Move Volume')], + nvmedisconnect: ['NVMe-oF', gettext('Disconnect')], 'pbs-download': ['VM/CT', gettext('File Restore Download')], pull_file: ['CT', gettext('Pull file')], push_file: ['CT', gettext('Push file')], diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js index c85183766..830e8542a 100644 --- a/www/manager6/node/Config.js +++ b/www/manager6/node/Config.js @@ -398,7 +398,7 @@ Ext.define('PVE.node.Config', { ); } - // the LUN and iSCSI reads of the node accept either privilege + // the LUN, iSCSI and NVMe over Fabrics reads of the node accept either privilege if (caps.nodes['Sys.Audit'] || caps.storage['Datastore.Allocate']) { me.items.push( { @@ -414,6 +414,13 @@ Ext.define('PVE.node.Config', { iconCls: 'fa fa-bullseye', groups: ['san'], }, + { + xtype: 'pveNVMeOFControllerList', + title: 'NVMe over Fabrics', + itemId: 'san-nvmeof', + iconCls: 'fa fa-plug', + groups: ['san'], + }, ); } diff --git a/www/manager6/node/NVMeOFControllers.js b/www/manager6/node/NVMeOFControllers.js new file mode 100644 index 000000000..cad9b4cbc --- /dev/null +++ b/www/manager6/node/NVMeOFControllers.js @@ -0,0 +1,152 @@ +Ext.define('PVE.node.NVMeOFControllerList', { + extend: 'Ext.grid.Panel', + xtype: 'pveNVMeOFControllerList', + onlineHelp: 'storage_nvmeof', + emptyText: gettext('No NVMe over Fabrics controllers found'), + viewConfig: { enableTextSelection: true }, + store: { + fields: [ + 'controller', + 'transport', + 'subsysnqn', + 'portal', + 'state', + 'namespaces', + 'used-by-storage', + ], + sorters: ['subsysnqn', 'portal'], + }, + columns: [ + { text: gettext('Controller'), dataIndex: 'controller', width: 100 }, + { + text: gettext('Subsystem'), + dataIndex: 'subsysnqn', + flex: 5, + renderer: Ext.htmlEncode, + }, + { + text: gettext('Transport'), + dataIndex: 'transport', + width: 90, + // the transport of the controller, named as for the paths of a namespace + renderer: (value) => PVE.SANUtils.renderSanTransport(value && `nvme-${value}`), + }, + { text: gettext('Portal'), dataIndex: 'portal', width: 180, renderer: Ext.htmlEncode }, + { + text: gettext('State'), + dataIndex: 'state', + width: 150, + renderer: PVE.SANUtils.renderState, + }, + { text: gettext('Namespaces'), dataIndex: 'namespaces', width: 110 }, + { + text: gettext('Storage'), + dataIndex: 'used-by-storage', + flex: 1, + renderer: Ext.htmlEncode, + }, + ], + + reload: function () { + let me = this; + let load = (path, success) => + Proxmox.Utils.API2Request({ + url: `/nodes/${me.nodename}/san/nvmeof/${path}`, + method: 'GET', + waitMsgTarget: me.getView(), + failure: (response) => + Proxmox.Utils.setErrorMask(me.getView(), response.htmlStatus), + success: (response) => !me.destroyed && success(response.result.data), + }); + load('status', function (status) { + me.down('#hostnqn').setValue(status['host-nqn'] || ''); + me.supported = !!status.supported; + let error = status.supported + ? status.error + : gettext('nvme-cli is not installed on this node.'); + // the controllers come from sysfs, which needs neither nvme-cli nor a host identity + let warning = me.down('#warning'); + warning.setHtml( + error + ? ` ${Ext.htmlEncode(error)}` + : '', + ); + warning.setHidden(!error); + load('controller', function (controllers) { + Proxmox.Utils.setErrorMask(me.getView(), false); + me.getStore().setData(controllers); + }); + }); + }, + + listeners: { + activate: function () { + this.reload(); + }, + }, + + initComponent: function () { + let me = this; + me.nodename = me.pveSelNode.data.node; + me.tbar = [ + { text: gettext('Reload'), iconCls: 'fa fa-refresh', handler: () => me.reload() }, + { + xtype: 'proxmoxButton', + text: gettext('Disconnect'), + iconCls: 'fa fa-unlink', + disabled: true, + dangerous: true, + // the disconnect uses nvme-cli + enableFn: () => !!Ext.state.Manager.get('GuiCap').dc['Sys.Modify'] && me.supported, + confirmMsg: (rec) => + Ext.String.format( + gettext( + 'Disconnect controller {0} from portal {1}? A storage that still lists that portal connects to it again.', + ), + Ext.htmlEncode(rec.get('controller')), + Ext.htmlEncode(rec.get('portal')), + ), + handler: (button, event, rec) => + Proxmox.Utils.API2Request({ + // refused if the kernel reused the controller number meanwhile + url: + `/nodes/${me.nodename}/san/nvmeof/controller/${rec.get('controller')}?` + + Ext.Object.toQueryString({ + subsysnqn: rec.get('subsysnqn'), + portal: rec.get('portal'), + }), + method: 'DELETE', + waitMsgTarget: me, + failure: (response) => Ext.Msg.alert(gettext('Error'), response.htmlStatus), + success: (response) => + Ext.create('Proxmox.window.TaskProgress', { + upid: response.result.data, + autoShow: true, + taskDone: () => !me.destroyed && me.reload(), + }), + }), + }, + '->', + { + xtype: 'displayfield', + itemId: 'hostnqn', + fieldLabel: gettext('Host NQN'), + }, + { + iconCls: 'fa fa-clipboard', + tooltip: gettext('Copy to Clipboard'), + handler: () => PVE.Utils.copyToClipboard(me.down('#hostnqn').getValue()), + }, + ]; + me.dockedItems = [ + { + xtype: 'component', + itemId: 'warning', + dock: 'top', + padding: 5, + hidden: true, + }, + ]; + me.callParent(); + }, +});