From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 9B8321FF0E3 for ; Wed, 18 Nov 2026 21:45:05 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EAE2E219AF; Wed, 18 Nov 2026 21:43:34 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v2 manager 15/17] ui: node: san: list NVMe over Fabrics controllers Date: Wed, 18 Nov 2026 21:42:34 +0100 Message-ID: <20261118204302.3100813-16-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118204302.3100813-1-t.lamprecht@proxmox.com> References: <20261118204302.3100813-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: 1795034588003 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.162 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: CBC5PAWSLZ32ZULVQANJCONG7UNOOFKC X-Message-ID-Hash: CBC5PAWSLZ32ZULVQANJCONG7UNOOFKC 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, their state and the storage they belong to, and the host NQN of the node. A controller can be disconnected from there, for example after its portal was removed from the storage. The node refuses that for the last usable path of a namespace in use. 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 | 115 +++++++++++++++++++++++++ 5 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 www/manager6/node/NVMeOFControllers.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 1fbce8c4d..5877c660d 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -252,6 +252,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 1b2b25c12..2a4877df5 100644 --- a/www/manager6/SANUtils.js +++ b/www/manager6/SANUtils.js @@ -135,6 +135,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')], }[value]; let [icon, label] = display ?? ['question-circle faded', value]; return ` ${Ext.htmlEncode(label)}`; diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index ef8218918..5610f0020 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -2268,6 +2268,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 476463a65..f6c2506b2 100644 --- a/www/manager6/node/Config.js +++ b/www/manager6/node/Config.js @@ -385,7 +385,7 @@ Ext.define('PVE.node.Config', { ); } - // the san-luns and iscsi reads accept either privilege + // the san-luns, iscsi and nvmeof reads accept either privilege if (caps.nodes['Sys.Audit'] || caps.storage['Datastore.Allocate']) { me.items.push( { @@ -401,6 +401,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..93955442d --- /dev/null +++ b/www/manager6/node/NVMeOFControllers.js @@ -0,0 +1,115 @@ +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', '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('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}/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'] || ''); + let error = status.supported + ? status.error + : gettext('nvme-cli is not installed on this node.'); + if (error) { + Proxmox.Utils.setErrorMask(me.getView(), Ext.htmlEncode(error)); + return; + } + 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, + enableFn: () => !!Ext.state.Manager.get('GuiCap').dc['Sys.Modify'], + confirmMsg: (rec) => + Ext.String.format( + gettext( + 'Disconnect controller {0}? A storage that still lists its portal connects to it again.', + ), + Ext.htmlEncode(rec.get('controller')), + ), + handler: (button, event, rec) => + Proxmox.Utils.API2Request({ + url: `/nodes/${me.nodename}/nvmeof/controller/${rec.get('controller')}`, + 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.callParent(); + }, +});