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 D4BEB1FF0E1 for ; Mon, 16 Nov 2026 02:28:29 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6A4A6217D6; Mon, 16 Nov 2026 02:25:57 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v5 manager 31/36] ui: node: add SAN LUNs panel Date: Mon, 16 Nov 2026 02:23:40 +0100 Message-ID: <20261116012355.3187417-32-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261116012355.3187417-1-t.lamprecht@proxmox.com> References: <20261116012355.3187417-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: 1794792243094 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.205 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: BLAB6PYXFVTSAKMCWJWBTX75TOCWESOV X-Message-ID-Hash: BLAB6PYXFVTSAKMCWJWBTX75TOCWESOV 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: Show the LUNs a node sees from a SAN under Node > SAN, separate from the local disks: identity, size, transport, usage and how multipath handles each LUN, with the state of every path in the expanded row. Admins no longer need "multipath -ll" or sysfs to check a node. For a LUN not reached over iSCSI, such as a Fibre Channel LUN, multipath can be enabled from here. Node auditors and storage administrators can open the view, matching the API permissions. Co-authored-by: Dietmar Maurer Signed-off-by: Dietmar Maurer Signed-off-by: Thomas Lamprecht --- www/manager6/Makefile | 1 + www/manager6/SANUtils.js | 68 ++++++++++++++ www/manager6/node/Config.js | 15 ++++ www/manager6/node/SANLuns.js | 170 +++++++++++++++++++++++++++++++++++ 4 files changed, 254 insertions(+) create mode 100644 www/manager6/node/SANLuns.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index f268a4d70..723007220 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -249,6 +249,7 @@ JSSRC= \ node/Directory.js \ node/LVM.js \ node/LVMThin.js \ + node/SANLuns.js \ node/StatusView.js \ node/Subscription.js \ node/Summary.js \ diff --git a/www/manager6/SANUtils.js b/www/manager6/SANUtils.js index e83f8533c..a3920db2b 100644 --- a/www/manager6/SANUtils.js +++ b/www/manager6/SANUtils.js @@ -1,3 +1,31 @@ +Ext.define('pve-san-lun', { + extend: 'Ext.data.Model', + idProperty: 'wwid', + fields: [ + 'wwid', + 'name', + 'devpath', + 'by-id', + 'size', + 'transport', + 'vendor', + 'model', + 'serial', + 'state', + 'paths-active', + 'paths-total', + 'path-list', + 'usage', + 'vgname', + 'detail', + 'used-by-storage', + 'multipath', + 'multipath-storage', + 'iscsi-target', + 'iscsi-lun', + ], +}); + Ext.define('PVE.SANUtils', { singleton: true, @@ -49,4 +77,44 @@ Ext.define('PVE.SANUtils', { let [icon, label] = display ?? ['question-circle faded', value]; return ` ${Ext.htmlEncode(label)}`; }, + + renderSanLunMultipath: function (value, metaData, rec) { + return Ext.htmlEncode(PVE.SANUtils.multipathText(value, rec.get('multipath-storage'))); + }, + + usageText: function (row) { + return ( + row['used-by-storage'] || + row.vgname || + row.detail || + { + unused: gettext('Unused'), + lvm: gettext('LVM physical volume'), + other: gettext('Other'), + }[row.usage] || + '' + ); + }, + + renderSanLunUsage: function (value, metaData, rec) { + return Ext.htmlEncode(PVE.SANUtils.usageText(rec.data)); + }, + + renderSanTransport: function (value) { + return Ext.htmlEncode( + { + iscsi: 'iSCSI', + iser: 'iSER', + fc: 'FC', + fcoe: 'FCoE', + sas: 'SAS', + nvme: 'NVMe', + 'nvme-tcp': 'NVMe/TCP', + 'nvme-rdma': 'NVMe/RDMA', + 'nvme-fc': 'NVMe/FC', + }[value] ?? + value ?? + '', + ); + }, }); diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js index 217ee284c..7b1222817 100644 --- a/www/manager6/node/Config.js +++ b/www/manager6/node/Config.js @@ -357,6 +357,21 @@ Ext.define('PVE.node.Config', { groups: ['storage'], xtype: 'pveZFSList', }, + ); + } + + // the san-luns read accepts either privilege + if (caps.nodes['Sys.Audit'] || caps.storage['Datastore.Allocate']) { + me.items.push({ + xtype: 'pveSANLunList', + title: 'SAN', + itemId: 'san', + iconCls: 'fa fa-cubes', + }); + } + + if (caps.nodes['Sys.Audit']) { + me.items.push( { xtype: 'pveNodeCephStatus', title: 'Ceph', diff --git a/www/manager6/node/SANLuns.js b/www/manager6/node/SANLuns.js new file mode 100644 index 000000000..dc659dd24 --- /dev/null +++ b/www/manager6/node/SANLuns.js @@ -0,0 +1,170 @@ +Ext.define('PVE.node.SANLunList', { + extend: 'Ext.grid.Panel', + xtype: 'pveSANLunList', + onlineHelp: 'storage_multipath', + stateful: true, + stateId: 'grid-node-san-luns', + emptyText: gettext('No LUNs found. Check connections and array access.'), + viewConfig: { enableTextSelection: true }, + + plugins: [ + { + ptype: 'rowexpander', + expandOnDblClick: false, + rowBodyTpl: [ + '{[this.paths(values)]}', + { + paths: function (values) { + let columns = [ + ['device', gettext('Path')], + ['state', gettext('State')], + ['checker-state', gettext('Checker')], + ['ana-state', 'ANA'], + ['host-wwpn', gettext('Host WWPN')], + ['target-wwpn', gettext('Target WWPN')], + ['address', gettext('Address')], + ]; + let paths = values['path-list'] || []; + columns = columns.filter(([key]) => + paths.some((path) => path[key] !== undefined), + ); + let headers = columns + .map(([, label]) => `${Ext.htmlEncode(label)}`) + .join(''); + let rows = paths + .map( + (path) => + '' + + columns + .map( + ([key]) => + `${Ext.htmlEncode(path[key] ?? '')}`, + ) + .join('') + + '', + ) + .join(''); + return `${headers}${rows}
`; + }, + }, + ], + }, + ], + columns: [ + { + text: gettext('Name'), + dataIndex: 'name', + flex: 2, + minWidth: 150, + renderer: (value, md, rec) => Ext.htmlEncode(value || rec.get('wwid')), + }, + { text: 'WWID', dataIndex: 'wwid', flex: 2, hidden: true, renderer: Ext.htmlEncode }, + { + text: gettext('State'), + dataIndex: 'state', + width: 120, + renderer: (value, md, rec) => + PVE.SANUtils.renderState(PVE.SANUtils.lunState(value, rec.get('paths-total'))), + }, + { + text: gettext('Multipath'), + dataIndex: 'multipath', + width: 150, + renderer: PVE.SANUtils.renderSanLunMultipath, + }, + { + text: gettext('Used By'), + dataIndex: 'usage', + flex: 1, + renderer: PVE.SANUtils.renderSanLunUsage, + }, + { + text: gettext('Device'), + dataIndex: 'devpath', + width: 180, + hidden: true, + renderer: Ext.htmlEncode, + }, + { + text: gettext('Size'), + dataIndex: 'size', + width: 100, + renderer: Proxmox.Utils.render_size, + }, + { + text: gettext('Transport'), + dataIndex: 'transport', + width: 100, + renderer: PVE.SANUtils.renderSanTransport, + }, + { text: 'LUN', dataIndex: 'iscsi-lun', width: 60, hidden: true }, + { + text: gettext('Vendor'), + dataIndex: 'vendor', + width: 100, + hidden: true, + renderer: Ext.htmlEncode, + }, + { + text: gettext('Model'), + dataIndex: 'model', + width: 140, + hidden: true, + renderer: Ext.htmlEncode, + }, + { + text: gettext('Serial'), + dataIndex: 'serial', + width: 140, + hidden: true, + renderer: Ext.htmlEncode, + }, + ], + + initComponent: function () { + let me = this; + me.nodename = me.pveSelNode.data.node; + me.rstore = Ext.create('Proxmox.data.UpdateStore', { + storeid: `san-luns-${me.nodename}`, + model: 'pve-san-lun', + interval: 5000, + proxy: { + type: 'proxmox', + url: `/api2/json/nodes/${me.nodename}/scan/san-luns`, + }, + }); + me.store = Ext.create('Proxmox.data.DiffStore', { rstore: me.rstore }); + let reload = () => me.rstore.load(); + let caps = Ext.state.Manager.get('GuiCap'); + me.tbar = [ + { text: gettext('Reload'), iconCls: 'fa fa-refresh', handler: reload }, + { + xtype: 'proxmoxButton', + text: gettext('Enable Multipath'), + disabled: true, + enableFn: (rec) => + !!caps.dc['Sys.Modify'] && + rec.get('multipath') === 'none' && + !rec.get('iscsi-target') && + !['iscsi', 'iser'].includes(rec.get('transport')), + handler: (button, event, rec) => + Proxmox.Utils.API2Request({ + url: '/cluster/multipath/wwid', + method: 'POST', + params: { wwid: rec.get('wwid') }, + waitMsgTarget: me, + failure: (response) => Ext.Msg.alert(gettext('Error'), response.htmlStatus), + success: reload, + }), + }, + ]; + me.callParent(); + Proxmox.Utils.monStoreErrors(me, me.rstore); + me.on('activate', () => me.rstore.startUpdate()); + me.on('deactivate', () => me.rstore.stopUpdate()); + me.on('destroy', () => { + me.store.destroy(); + me.rstore.destroy(); + }); + }, +});