all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-manager 2/3] ui: san: iscsi guided setup: don't allow nodes without open-iscsi
Date: Fri, 20 Nov 2026 13:51:54 +0100	[thread overview]
Message-ID: <20261120125236.2393788-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20261120125236.2393788-1-d.csapak@proxmox.com>

without open-iscsi, the iSCSI storage can't be activated on a node,
but the node list only showed the multipath state, so such a node
showed up as 'OK' and could be selected without any warning.

Since nodes only report their initiator name if open-iscsi is
installed, show 'open-iscsi not installed' as state for nodes without
one, and show an error when trying to continue while the storages
would be on one of them, so the user can either install it or
restrict the nodes.

Do that check only after we know the nodes of the setup, since when
reusing an existing connection storage without selecting any nodes,
the setup uses the nodes of that storage, not all nodes.

Nodes that are not upgraded yet might still report a leftover name,
so they are not flagged in that case.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/SANUtils.js                      |  6 ++++
 www/manager6/storage/wizard/IScsi.js          | 28 +++++++++++++++++++
 www/manager6/storage/wizard/NodeIdentities.js | 16 +++++++++--
 3 files changed, 47 insertions(+), 3 deletions(-)

diff --git a/www/manager6/SANUtils.js b/www/manager6/SANUtils.js
index f4905e68..90ddd1eb 100644
--- a/www/manager6/SANUtils.js
+++ b/www/manager6/SANUtils.js
@@ -124,6 +124,11 @@ Ext.define('PVE.SANUtils', {
         );
     },
 
+    // nodes only report an initiator name if they have a usable open-iscsi
+    iscsiMissing: function (report) {
+        return report.state !== 'no-report' && !report['iscsi-initiator-name'];
+    },
+
     renderState: function (value) {
         if (!value) {
             return '';
@@ -138,6 +143,7 @@ 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')],
+            'no-iscsi': ['times-circle critical', gettext('open-iscsi not installed')],
             'logged-in': ['check-circle good', gettext('Connected')],
             recovering: ['exclamation-circle warning', gettext('Reconnecting')],
             'not-connected': ['times-circle faded', gettext('Not connected')],
diff --git a/www/manager6/storage/wizard/IScsi.js b/www/manager6/storage/wizard/IScsi.js
index f9a53793..26f346ec 100644
--- a/www/manager6/storage/wizard/IScsi.js
+++ b/www/manager6/storage/wizard/IScsi.js
@@ -49,6 +49,28 @@ Ext.define('PVE.storage.wizard.IScsiTarget', {
             tabs.setActiveTab(wizard.down('#luns'));
             me.disable();
         };
+        // checks the nodes the storages will be on, an empty list means all nodes
+        let missingOpenIscsi = function (storageNodes) {
+            let missing = me
+                .down('pveStorageWizardNodeIdentities')
+                .rstore.getRange()
+                .filter((rec) => rec.get('iscsi-missing'))
+                .map((rec) => rec.get('node'))
+                .filter((node) => !storageNodes.length || storageNodes.includes(node));
+            if (missing.length) {
+                wizard.showError(
+                    Ext.htmlEncode(
+                        Ext.String.format(
+                            gettext(
+                                'open-iscsi is not installed on node(s) {0}. Install it there, or restrict the nodes in the advanced options.',
+                            ),
+                            missing.join(', '),
+                        ),
+                    ),
+                );
+            }
+            return missing.length > 0;
+        };
         let fail = (response) => wizard.showError(response.htmlStatus);
         Proxmox.Utils.API2Request({
             url: '/storage',
@@ -149,9 +171,15 @@ Ext.define('PVE.storage.wizard.IScsiTarget', {
                         );
                         return;
                     }
+                    if (missingOpenIscsi(selectedNodes)) {
+                        return;
+                    }
                     connected(connection);
                     return;
                 }
+                if (missingOpenIscsi(nodes ? nodes.split(',') : [])) {
+                    return;
+                }
                 Proxmox.Utils.API2Request({
                     url: '/storage',
                     method: 'POST',
diff --git a/www/manager6/storage/wizard/NodeIdentities.js b/www/manager6/storage/wizard/NodeIdentities.js
index 7fb8e6b8..01d37f0c 100644
--- a/www/manager6/storage/wizard/NodeIdentities.js
+++ b/www/manager6/storage/wizard/NodeIdentities.js
@@ -1,7 +1,16 @@
 Ext.define('pve-san-node-identity', {
     extend: 'Ext.data.Model',
     idProperty: 'node',
-    fields: ['node', 'state', 'iscsi-initiator-name'],
+    fields: [
+        'node',
+        'state',
+        'iscsi-initiator-name',
+        {
+            name: 'iscsi-missing',
+            depends: ['state', 'iscsi-initiator-name'],
+            calculate: (data) => PVE.SANUtils.iscsiMissing(data),
+        },
+    ],
 });
 
 Ext.define('PVE.storage.wizard.NodeIdentities', {
@@ -15,8 +24,9 @@ Ext.define('PVE.storage.wizard.NodeIdentities', {
         {
             text: gettext('State'),
             dataIndex: 'state',
-            width: 175,
-            renderer: PVE.SANUtils.renderState,
+            width: 220,
+            renderer: (value, meta, rec) =>
+                PVE.SANUtils.renderState(rec.get('iscsi-missing') ? 'no-iscsi' : value),
         },
         {
             text: gettext('Initiator Name'),
-- 
2.47.3





  parent reply	other threads:[~2026-11-20 12:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 12:51 [PATCH manager/storage 0/3] san: show and check for missing open-iscsi on nodes Dominik Csapak
2026-11-20 12:51 ` [PATCH pve-storage 1/3] multipath: status: only report initiator name if open-iscsi is installed Dominik Csapak
2026-11-20 12:51 ` Dominik Csapak [this message]
2026-11-20 12:51 ` [PATCH pve-manager 3/3] ui: dc: san: show missing open-iscsi in the node grid Dominik Csapak

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=20261120125236.2393788-3-d.csapak@proxmox.com \
    --to=d.csapak@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