From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id BE2AD1FF146 for ; Tue, 26 May 2026 10:43:17 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3669516A4A; Tue, 26 May 2026 10:43:16 +0200 (CEST) Message-ID: Date: Tue, 26 May 2026 10:42:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 storage 08/15] iscsi: rework to update discovery db and simplify login To: Thomas Lamprecht , Proxmox VE development discussion References: <20260430173220.441001-1-m.limbeck@proxmox.com> <20260430173220.441001-9-m.limbeck@proxmox.com> <20260523212856.2822353-6-t.lamprecht@proxmox.com> Content-Language: en-US From: Mira Limbeck In-Reply-To: <20260523212856.2822353-6-t.lamprecht@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1779784937711 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.351 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [iscsiplugin.pm] Message-ID-Hash: VGUFWBZL5AY773AV6O2HXZWRNY7MPLX2 X-Message-ID-Hash: VGUFWBZL5AY773AV6O2HXZWRNY7MPLX2 X-MailFrom: m.limbeck@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: On 5/23/26 11:28 PM, Thomas Lamprecht wrote: > On Thu, 30 Apr 2026 19:27:06 +0200, Mira Limbeck wrote: >> diff --git a/src/PVE/Storage/ISCSIPlugin.pm b/src/PVE/Storage/ISCSIPlugin.pm >> @@ -699,32 +703,30 @@ sub activate_storage { >> my $do_login = 0; >> + my $login_targets = {}; >> for my $target (keys $targets->%*) { >> - $do_login = 1 if !defined($targets->{$target}->{sessions}); >> - } >> - >> - if (!$do_login) { >> - # We should check that sessions for all portals are available >> - for my $target (keys $targets->%*) { >> - my $session_portals = [map { $_->{portal} } ($targets->{$target}->{sessions}->@*)]; >> - for my $portal ($targets->{$target}->{portals}->@*) { >> - if (!grep(/^\Q$portal\E(?::3260)?$/, $session_portals->@*)) { >> - $do_login = 1; >> - last; >> - } >> + my $sessions = [map { $_->{portal} } ($targets->{$target}->{sessions}->@*)]; >> + for my $portal ($targets->{$target}->{portals}->@*) { >> + if (!grep(/\Q$portal\E$/, $sessions->@*)) { >> + push $login_targets->{$target}->@*, $portal; >> } >> } >> } > > This dropped the leading `^` anchor that the removed code had. With only the > trailing `$` the config portal is matched as a suffix of the session string, > so e.g. "10.0.0.4:3260" matches a session for host "110.0.0.4". Any reason > for not keeping the exact `^...$` match? No, that was an oversight. > >> @@ -259,7 +256,14 @@ sub iscsi_login { >> - run_command([$ISCSIADM, '--mode', 'node', '--targetname', $target, '--login']); >> + # iscsiadm warns if some target/portals are already logged in >> + # a workaround would be to check each of them and only log in on those >> + # that have no session yet, rather than just doing a log in per node >> + my $cmd = [ >> + $ISCSIADM, '--mode', 'node', '--targetname', $target, '--login', >> + ]; >> + eval { run_command($cmd); }; >> + warn $@ if $@; > > Login was an un-evaled hard call before; now a total login failure only > warns and activate_storage returns success, while check_connection only > pings portals - so activation can report success with zero usable LUNs. > Might be still worth distinguishing "all logins failed" and propagating > that. Will adapt. Although with Samuel's findings on patch 07/15, it may be necessary to rework the way logins work in general. Possibly to log in to each target/portal combination separately, rather than all portals for a target in one go.