From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 24AAF1FF0AF for ; Fri, 20 Nov 2026 13:52:55 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id AC0D32176E; Fri, 20 Nov 2026 13:52:40 +0100 (CET) From: Dominik Csapak 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 Message-ID: <20261120125236.2393788-3-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261120125236.2393788-1-d.csapak@proxmox.com> References: <20261120125236.2393788-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.269 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: 3ELMH3JWXX3JVPWY2DYAAP64OKEZK7QP X-Message-ID-Hash: 3ELMH3JWXX3JVPWY2DYAAP64OKEZK7QP X-MailFrom: d.csapak@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: 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 --- 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