all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH v7 manager 38/43] ui: node: san: show iSCSI targets and sessions
Date: Wed, 18 Nov 2026 21:26:21 +0100	[thread overview]
Message-ID: <20261118202646.3017286-39-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20261118202646.3017286-1-t.lamprecht@proxmox.com>

From: Dietmar Maurer <dietmar@proxmox.com>

The LUN list cannot show how a node is connected to an iSCSI target. Add
a view below Node > SAN with the targets, their portals with the session
state, and the devices of each session. Portals that the node knows but
has no session to are listed as not connected.

Show the initiator name of the node with a copy button, as the access
rules of an array need it. If open-iscsi is not installed, the view says
so instead of showing an empty tree.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
[TL: keep the view read-only, without rescan, logout, record removal
 and session details; add the search field; reword the commit message
 accordingly]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 www/manager6/Makefile             |   1 +
 www/manager6/SANUtils.js          |   3 +
 www/manager6/node/Config.js       |  23 +++--
 www/manager6/node/ISCSITargets.js | 150 ++++++++++++++++++++++++++++++
 4 files changed, 170 insertions(+), 7 deletions(-)
 create mode 100644 www/manager6/node/ISCSITargets.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 14020e8db..4a6c8af72 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -248,6 +248,7 @@ JSSRC= 							\
 	node/CmdMenu.js					\
 	node/Config.js					\
 	node/Directory.js				\
+	node/ISCSITargets.js				\
 	node/LVM.js					\
 	node/LVMThin.js					\
 	node/SANLuns.js					\
diff --git a/www/manager6/SANUtils.js b/www/manager6/SANUtils.js
index 3d7ab7952..5cd8abd76 100644
--- a/www/manager6/SANUtils.js
+++ b/www/manager6/SANUtils.js
@@ -114,6 +114,9 @@ Ext.define('PVE.SANUtils', {
             unknown: ['question-circle faded', gettext('Unknown')],
             unavailable: ['exclamation-circle warning', gettext('Multipath unavailable')],
             'no-report': ['question-circle faded', gettext('No current report')],
+            'logged-in': ['check-circle good', gettext('Connected')],
+            recovering: ['exclamation-circle warning', gettext('Reconnecting')],
+            'not-connected': ['times-circle faded', gettext('Not connected')],
         }[value];
         let [icon, label] = display ?? ['question-circle faded', value];
         return `<i class="fa fa-fw fa-${icon}"></i> ${Ext.htmlEncode(label)}`;
diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js
index 5caef1edf..476463a65 100644
--- a/www/manager6/node/Config.js
+++ b/www/manager6/node/Config.js
@@ -385,14 +385,23 @@ Ext.define('PVE.node.Config', {
             );
         }
 
-        // the san-luns read accepts either privilege
+        // the san-luns and iscsi reads accept either privilege
         if (caps.nodes['Sys.Audit'] || caps.storage['Datastore.Allocate']) {
-            me.items.push({
-                xtype: 'pveSANLunList',
-                title: 'SAN',
-                itemId: 'san',
-                iconCls: 'fa fa-cubes',
-            });
+            me.items.push(
+                {
+                    xtype: 'pveSANLunList',
+                    title: 'SAN',
+                    itemId: 'san',
+                    iconCls: 'fa fa-cubes',
+                },
+                {
+                    xtype: 'pveISCSITargetTree',
+                    title: 'iSCSI',
+                    itemId: 'san-iscsi',
+                    iconCls: 'fa fa-bullseye',
+                    groups: ['san'],
+                },
+            );
         }
 
         if (caps.nodes['Sys.Audit']) {
diff --git a/www/manager6/node/ISCSITargets.js b/www/manager6/node/ISCSITargets.js
new file mode 100644
index 000000000..23cb7d0ff
--- /dev/null
+++ b/www/manager6/node/ISCSITargets.js
@@ -0,0 +1,150 @@
+Ext.define('PVE.node.ISCSITargetTree', {
+    extend: 'Ext.tree.Panel',
+    xtype: 'pveISCSITargetTree',
+    onlineHelp: 'storage_open_iscsi',
+    rootVisible: false,
+    viewConfig: { emptyText: gettext('No iSCSI targets found'), enableTextSelection: true },
+    store: {
+        type: 'tree',
+        fields: ['text', 'state', 'session-id', 'used-by-storage', 'lun'],
+        root: { expanded: true, children: [] },
+    },
+    columns: [
+        {
+            xtype: 'treecolumn',
+            text: gettext('Target'),
+            dataIndex: 'text',
+            flex: 3,
+            renderer: Ext.htmlEncode,
+        },
+        {
+            text: gettext('State'),
+            dataIndex: 'state',
+            width: 150,
+            renderer: PVE.SANUtils.renderState,
+        },
+        { text: gettext('Session ID'), dataIndex: 'session-id', width: 100 },
+        { text: 'LUN', dataIndex: 'lun', width: 70 },
+        {
+            text: gettext('Connection Storage'),
+            dataIndex: 'used-by-storage',
+            flex: 1,
+            renderer: Ext.htmlEncode,
+        },
+    ],
+
+    reload: function () {
+        let me = this;
+        Proxmox.Utils.API2Request({
+            url: `/nodes/${me.nodename}/iscsi/status`,
+            method: 'GET',
+            waitMsgTarget: me.getView(),
+            failure: (response) => Proxmox.Utils.setErrorMask(me.getView(), response.htmlStatus),
+            success: function (response) {
+                if (me.destroyed) {
+                    return;
+                }
+                let status = response.result.data;
+                me.down('#initiator').setValue(status['initiator-name'] || '');
+                if (!status.supported) {
+                    Proxmox.Utils.setErrorMask(
+                        me.getView(),
+                        gettext('open-iscsi is not installed on this node.'),
+                    );
+                    return;
+                }
+                Proxmox.Utils.API2Request({
+                    url: `/nodes/${me.nodename}/iscsi/target`,
+                    method: 'GET',
+                    waitMsgTarget: me.getView(),
+                    failure: (res) => Proxmox.Utils.setErrorMask(me.getView(), res.htmlStatus),
+                    success: function (res) {
+                        if (me.destroyed) {
+                            return;
+                        }
+                        Proxmox.Utils.setErrorMask(me.getView(), false);
+                        me.sessions = res.result.data;
+                        me.updateTree();
+                    },
+                });
+            },
+        });
+    },
+
+    // Shows the loaded portals that match the search text, in one of their own values or in a
+    // device of their session, below their targets.
+    updateTree: function () {
+        let me = this;
+        if (!me.sessions) {
+            return;
+        }
+        let query = (me.down('pveRecordSearchField').getValue() ?? '').toLowerCase();
+        let matches = (row) =>
+            !query ||
+            [row.target, row.portal, row['used-by-storage'], ...row.devices.map((d) => d.devpath)]
+                .filter(Boolean)
+                .some((value) => value.toLowerCase().includes(query));
+        let targets = {};
+        for (let row of me.sessions.filter(matches)) {
+            targets[row.target] ??= {
+                text: row.target,
+                iconCls: 'fa fa-bullseye',
+                expanded: true,
+                children: [],
+            };
+            targets[row.target].children.push({
+                text: row.portal,
+                state: row.state,
+                'session-id': row['session-id'],
+                'used-by-storage': row['used-by-storage'],
+                iconCls: 'fa fa-link',
+                expanded: true,
+                leaf: !row.devices.length,
+                children: row.devices.map((device) => ({
+                    text: device.devpath,
+                    lun: device.lun,
+                    iconCls: 'fa fa-hdd-o',
+                    leaf: true,
+                })),
+            });
+        }
+        me.setRootNode({ expanded: true, children: Object.values(targets) });
+    },
+
+    listeners: {
+        activate: function () {
+            this.reload();
+        },
+    },
+
+    initComponent: function () {
+        let me = this;
+        me.nodename = me.pveSelNode.data.node;
+        me.tbar = {
+            overflowHandler: 'scroller',
+            items: [
+                { text: gettext('Reload'), iconCls: 'fa fa-refresh', handler: () => me.reload() },
+                '->',
+                {
+                    xtype: 'displayfield',
+                    itemId: 'initiator',
+                    fieldLabel: gettext('Initiator Name'),
+                },
+                {
+                    iconCls: 'fa fa-clipboard',
+                    tooltip: gettext('Copy to Clipboard'),
+                    handler: () => PVE.Utils.copyToClipboard(me.down('#initiator').getValue()),
+                },
+                ' ',
+                gettext('Search') + ':',
+                ' ',
+                {
+                    xtype: 'pveRecordSearchField',
+                    emptyText: gettext('Target, Portal, Storage'),
+                    listeners: { searchchange: () => me.updateTree() },
+                },
+            ],
+        };
+        me.callParent();
+    },
+});




  parent reply	other threads:[~2026-11-18 20:32 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 20:25 [PATCH v7 cluster,storage,docs,manager 00/43] SAN: cluster-wide multipath, SAN views and a guided setup for shared LVM Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 cluster 01/43] cfs: observe the multipath configuration files Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 02/43] diskmanage: collect disk transport type from lsblk Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 03/43] diskmanage: qualify NVMe over Fabrics transport Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 04/43] diskmanage: optionally include iSCSI session devices in disk enumeration Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 05/43] diskmanage: collect native NVMe multipath path state Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 06/43] iscsi: factor out session device map from device list Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 07/43] multipath: add a library around multipathd Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 08/43] diskmanage: add helper to list multipath devices Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 09/43] multipath: add a cluster-wide configuration Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 10/43] iscsi: add an option to manage storage LUNs with multipath Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 11/43] lvm: activate a missing base volume before using the volume group Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 12/43] multipath: apply the configuration on every node Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 13/43] multipath: publish per-node status Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 14/43] api: add endpoints for the cluster-wide multipath configuration Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 15/43] api: multipath: add the cluster-wide health status Thomas Lamprecht
2026-11-18 20:25 ` [PATCH v7 storage 16/43] diskmanage: look up the requested disks by name Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 storage 17/43] diskmanage: read the udev data of all disks with one call Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 storage 18/43] api: scan: add a SAN LUN inventory Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 storage 19/43] pvesm: expose the " Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 storage 20/43] api: add node-level iSCSI status Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 storage 21/43] api: scan: name the portal of an iSCSI path Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 storage 22/43] disks: lvm: drop unused imports Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 storage 23/43] disks: lvm: allow volume groups on SAN LUNs and multipath maps Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 storage 24/43] disks: lvm: refuse to destroy the volume group of a shared storage Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 storage 25/43] disks: allow wiping a SAN LUN that no storage uses Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 storage 26/43] api: scan: report the process that has a SAN LUN open Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 docs 27/43] storage: document the cluster-wide multipath management Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 docs 28/43] storage: multipath: describe the use shown for an open LUN Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 29/43] pvestatd: apply the multipath configuration and report the node status Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 30/43] report: add the managed multipath configuration Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 31/43] api: cluster: add the multipath endpoints Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 32/43] api: nodes: expose the iSCSI status Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 33/43] ui: dc: add a SAN view Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 34/43] ui: storage: iscsi: add the multipath option Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 35/43] ui: lvm: enable shared when a base storage is selected Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 36/43] ui: node: add SAN LUNs panel Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 37/43] ui: node: san: wipe a LUN that no storage uses Thomas Lamprecht
2026-11-18 20:26 ` Thomas Lamprecht [this message]
2026-11-18 20:26 ` [PATCH v7 manager 39/43] ui: dc: san: add a guided setup for shared LVM on iSCSI Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 40/43] ui: dc: san: add a guided setup for shared LVM on Fibre Channel Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 41/43] ui: storage: point the iSCSI and LVM add dialogs to the SAN view Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 42/43] ui: san: show the guest or process that has a LUN open Thomas Lamprecht
2026-11-18 20:26 ` [PATCH v7 manager 43/43] ui: node: san: add a column for the target or subsystem of a LUN Thomas Lamprecht
2026-11-19 19:49 ` superseded: [PATCH v7 cluster,storage,docs,manager 00/43] 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=20261118202646.3017286-39-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal