public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH v4 manager 31/36] ui: node: add SAN LUNs panel
Date: Fri, 13 Nov 2026 04:00:49 +0100	[thread overview]
Message-ID: <20261113030146.1559030-32-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20261113030146.1559030-1-t.lamprecht@proxmox.com>

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 <dietmar@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 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 `<i class="fa fa-fw fa-${icon}"></i> ${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]) => `<th>${Ext.htmlEncode(label)}</th>`)
+                            .join('');
+                        let rows = paths
+                            .map(
+                                (path) =>
+                                    '<tr>' +
+                                    columns
+                                        .map(
+                                            ([key]) =>
+                                                `<td>${Ext.htmlEncode(path[key] ?? '')}</td>`,
+                                        )
+                                        .join('') +
+                                    '</tr>',
+                            )
+                            .join('');
+                        return `<table style="border-spacing: 10px 2px;"><tr>${headers}</tr>${rows}</table>`;
+                    },
+                },
+            ],
+        },
+    ],
+    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();
+        });
+    },
+});




  parent reply	other threads:[~2026-11-13  3:17 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13  3:00 [PATCH v4 cluster,storage,docs,manager 00/36] SAN: cluster-wide multipath, SAN views and a guided setup for shared LVM Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 cluster 01/36] cfs: observe the multipath configuration files Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 02/36] diskmanage: collect disk transport type from lsblk Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 03/36] diskmanage: qualify NVMe over fabrics transport Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 04/36] diskmanage: optionally include iSCSI session devices in disk enumeration Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 05/36] diskmanage: collect native NVMe multipath path state Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 06/36] iscsi: factor out session device map from device list Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 07/36] multipath: add a library around multipathd Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 08/36] diskmanage: add helper to list multipath devices Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 09/36] multipath: add a cluster-wide configuration Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 10/36] iscsi: add an option to manage storage LUNs with multipath Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 11/36] lvm: activate a missing base volume before using the volume group Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 12/36] multipath: apply the configuration on every node Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 13/36] multipath: publish per-node status Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 14/36] api: add endpoints for the cluster-wide multipath configuration Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 15/36] api: multipath: add the cluster-wide health status Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 16/36] api: scan: add a SAN LUN inventory Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 17/36] pvesm: expose the " Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 18/36] api: add node-level iSCSI status Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 19/36] disks: lvm: drop unused imports Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 20/36] disks: lvm: allow volume groups on SAN LUNs and multipath maps Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 21/36] disks: lvm: refuse to destroy the volume group of a shared storage Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 storage 22/36] disks: allow wiping a SAN LUN that no storage uses Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 docs 23/36] storage: document the cluster-wide multipath management Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 24/36] pvestatd: apply the multipath configuration and report the node status Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 25/36] report: add the managed multipath configuration Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 26/36] api: cluster: add the multipath endpoints Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 27/36] api: nodes: expose the iSCSI status Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 28/36] ui: dc: add a SAN view Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 29/36] ui: storage: iscsi: add the multipath option Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 30/36] ui: lvm: enable shared when a base storage is selected Thomas Lamprecht
2026-11-13  3:00 ` Thomas Lamprecht [this message]
2026-11-13  3:00 ` [PATCH v4 manager 32/36] ui: node: san: wipe a LUN that no storage uses Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 33/36] ui: node: san: show iSCSI targets and sessions Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 34/36] ui: dc: san: add a guided setup for shared LVM on iSCSI Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 35/36] ui: dc: san: add a guided setup for shared LVM on Fibre Channel Thomas Lamprecht
2026-11-13  3:00 ` [PATCH v4 manager 36/36] ui: storage: point the iSCSI and LVM add dialogs to the SAN view Thomas Lamprecht
2026-11-16  1:28 ` superseded: [PATCH v4 cluster,storage,docs,manager 00/36] SAN: cluster-wide multipath, SAN views and a guided setup for shared LVM Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261113030146.1559030-32-t.lamprecht@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal