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 704641FF0C0 for ; Wed, 18 Nov 2026 07:58:55 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7D32021B54; Wed, 18 Nov 2026 07:54:17 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v6 manager 35/42] ui: node: add SAN LUNs panel Date: Wed, 18 Nov 2026 07:52:52 +0100 Message-ID: <20261118065302.3033937-36-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118065302.3033937-1-t.lamprecht@proxmox.com> References: <20261118065302.3033937-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: 1794984789145 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.177 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: 2VFPDKN4AYULOQ24O2VYK5W3M6BG75NA X-Message-ID-Hash: 2VFPDKN4AYULOQ24O2VYK5W3M6BG75NA 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 that a node sees from a SAN under Node > SAN, separate from the local disks, with the state of every path in the expanded row. Admins no longer need "multipath -ll" or sysfs to check a node. A degraded or failed LUN shows its usable and expected paths, as the kernel removes a lost path after a while. A node can see many more LUNs than Proxmox VE uses, for example from a storage plugin with one LUN per guest disk. So the list has a search field, which also matches the devices, WWPNs and addresses of the paths. This way, the LUN of a path device named in the kernel log is easy to find. For a LUN not reached over iSCSI, such as a Fibre Channel LUN, Enable Multipath opens the dialog of an explicit entry with the WWID filled in. The entry applies to all nodes unless restricted, which the dialog shows. 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 | 95 ++++++++++++++++ www/manager6/node/Config.js | 15 +++ www/manager6/node/SANLuns.js | 202 +++++++++++++++++++++++++++++++++++ 4 files changed, 313 insertions(+) create mode 100644 www/manager6/node/SANLuns.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 9f5beb5f1..a1d4d5493 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 1900386c3..564c87374 100644 --- a/www/manager6/SANUtils.js +++ b/www/manager6/SANUtils.js @@ -1,3 +1,47 @@ +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', + 'paths-expected', + 'path-list', + 'usage', + 'vgname', + 'detail', + 'used-by-storage', + 'multipath', + 'multipath-storage', + 'iscsi-target', + 'iscsi-lun', + // what identifies the paths, as text for the search + { + name: 'path-search', + depends: ['path-list'], + calculate: (data) => + (data['path-list'] ?? []) + .flatMap((path) => [ + path.device, + path['host-wwpn'], + path['target-wwpn'], + path.address, + ]) + .filter(Boolean) + .join(' '), + }, + ], +}); + Ext.define('PVE.SANUtils', { singleton: true, @@ -57,4 +101,55 @@ Ext.define('PVE.SANUtils', { let [icon, label] = display ?? ['question-circle faded', value]; return ` ${Ext.htmlEncode(label)}`; }, + + // The path counts tell why a LUN is degraded while all of its listed paths are usable: the + // kernel removes a lost path after a while. + renderLunState: function (value, metaData, rec) { + let state = PVE.SANUtils.lunState(value, rec.get('paths-total')); + let text = PVE.SANUtils.renderState(state); + if (['degraded', 'failed'].includes(state) && rec.get('paths-active') !== undefined) { + text += ` (${Ext.htmlEncode(PVE.SANUtils.pathCount(rec.data))})`; + } + return text; + }, + + 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..c5b22f72f --- /dev/null +++ b/www/manager6/node/SANLuns.js @@ -0,0 +1,202 @@ +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: 140, + renderer: PVE.SANUtils.renderLunState, + }, + { + 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; + let noLunsText = me.emptyText; + 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 = { + overflowHandler: 'scroller', + items: [ + { 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')), + // the entry is for all nodes unless restricted, which the dialog shows + handler: (button, event, rec) => + Ext.create('PVE.dc.MultipathWwidEdit', { + wwid: rec.get('wwid'), + isCreate: true, + autoShow: true, + apiCallDone: (success) => success && reload(), + }), + }, + '->', + gettext('Search') + ':', + ' ', + { + xtype: 'pveRecordSearchField', + emptyText: gettext('Name, WWID, Storage'), + searchFields: [ + 'name', + 'wwid', + 'used-by-storage', + 'vgname', + 'detail', + 'multipath-storage', + 'devpath', + 'path-search', + 'vendor', + 'model', + 'serial', + ], + targetStore: me.store, + listeners: { + // no hit for a search is no sign of a connection problem + searchchange: (field, query) => + me.rendered && + me.setEmptyText( + query ? gettext('No LUNs match the search.') : noLunsText, + ), + }, + }, + ], + }; + me.callParent(); + Proxmox.Utils.monStoreErrors(me, me.rstore); + me.mon(me.store, 'refresh', () => PVE.SANUtils.deselectHidden(me)); + me.on('activate', () => me.rstore.startUpdate()); + me.on('deactivate', () => me.rstore.stopUpdate()); + me.on('destroy', () => { + me.store.destroy(); + me.rstore.destroy(); + }); + }, +});