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 D3E771FF0E3 for ; Wed, 18 Nov 2026 21:32:49 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 98DA921C1F; Wed, 18 Nov 2026 21:28:10 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v7 manager 36/43] ui: node: add SAN LUNs panel Date: Wed, 18 Nov 2026 21:26:19 +0100 Message-ID: <20261118202646.3017286-37-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118202646.3017286-1-t.lamprecht@proxmox.com> References: <20261118202646.3017286-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: 1795033613244 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.163 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: DHJY3HMAOMOY7WYPXTUETP24VVSQ4BYJ X-Message-ID-Hash: DHJY3HMAOMOY7WYPXTUETP24VVSQ4BYJ 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 LUN with a single path and no map shows Single path under Multipath rather than Not enabled, as it has no other path to fail over to. The node list of Datacenter > SAN links each node to its Node > SAN view, as the cluster-wide list only summarizes the state of a node. 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 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 | 114 +++++++++++++++++++- www/manager6/dc/SAN.js | 20 ++++ www/manager6/node/Config.js | 15 +++ www/manager6/node/SANLuns.js | 204 +++++++++++++++++++++++++++++++++++ 5 files changed, 352 insertions(+), 2 deletions(-) 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..3d7ab7952 100644 --- a/www/manager6/SANUtils.js +++ b/www/manager6/SANUtils.js @@ -1,3 +1,60 @@ +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', + // the texts of the Name and Used By columns, which also sort by them + { + name: 'display-name', + depends: ['name', 'wwid'], + calculate: (data) => data.name || data.wwid, + sortType: 'asUCString', + }, + { + name: 'used-by', + depends: ['used-by-storage', 'vgname', 'detail', 'usage'], + calculate: (data) => PVE.SANUtils.usageText(data), + sortType: 'asUCString', + }, + // 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, @@ -20,11 +77,15 @@ Ext.define('PVE.SANUtils', { return `${report['paths-active']}/${total}`; }, - // How the multipath of a LUN is managed, as plain text. - multipathText: function (value, storage) { + // How the multipath of a LUN is managed, as plain text. A LUN with one path and no map has no + // other path to fail over to. + multipathText: function (value, storage, pathsTotal) { if (value === 'storage' && storage) { return Ext.String.format(gettext('Storage "{0}"'), storage); } + if (value === 'none' && Number(pathsTotal) === 1) { + return gettext('Single path'); + } return ( { none: gettext('Not enabled'), @@ -57,4 +118,53 @@ 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'), rec.get('paths-total')), + ); + }, + + 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] || + '' + ); + }, + + 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/dc/SAN.js b/www/manager6/dc/SAN.js index 5f7b4d8a6..12afa65df 100644 --- a/www/manager6/dc/SAN.js +++ b/www/manager6/dc/SAN.js @@ -172,6 +172,26 @@ Ext.define('PVE.dc.SANView', { renderer: Proxmox.Utils.render_timestamp, hidden: true, }, + { + xtype: 'actioncolumn', + width: 30, + items: [ + { + iconCls: 'fa fa-chevron-right', + tooltip: gettext('Go to Node'), + isActionDisabled: (_view, _ri, _ci, _item, rec) => + !PVE.data.ResourceStore.getNodeById(rec.get('node')), + handler: function (view, _ri, _ci, _item, _event, rec) { + Ext.state.Manager.getProvider().set('nodetab', { + value: 'san', + }); + view.up('pveStdWorkspace').selectById( + `node/${rec.get('node')}`, + ); + }, + }, + ], + }, ], }, { diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js index 747119379..5caef1edf 100644 --- a/www/manager6/node/Config.js +++ b/www/manager6/node/Config.js @@ -382,6 +382,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..8d96bd126 --- /dev/null +++ b/www/manager6/node/SANLuns.js @@ -0,0 +1,204 @@ +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: 'display-name', + flex: 2, + minWidth: 150, + renderer: Ext.htmlEncode, + }, + { 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: 'used-by', + flex: 1, + renderer: Ext.htmlEncode, + }, + { + 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, + sortAfterUpdate: true, + }); + 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' && + ['fc', 'fcoe'].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(); + }); + }, +});