From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id DFA561FF185 for ; Mon, 23 Jun 2025 10:25:00 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8D1F5B68C; Mon, 23 Jun 2025 10:25:32 +0200 (CEST) Message-ID: Date: Mon, 23 Jun 2025 10:24:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion , Stelios Vailakakis References: Content-Language: en-US From: Friedrich Weber In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL -0.042 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_SBL_A 0.1 Contains URL's A record listed in the Spamhaus SBL blocklist [185.199.109.133, 185.199.108.133, 185.199.111.133, 185.199.110.133] Subject: Re: [pve-devel] [PATCH] iscsi: fix excessive connection test spam on storage monitoring X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Hi, Thanks for getting involved! On 20/06/2025 02:44, Stelios Vailakakis wrote: > Hi all, > > This patch addresses excessive "connection lost" and "connection reset" log > spam on iSCSI targets caused by Proxmox storage monitoring performing TCP > connection tests every 10 seconds, even when iSCSI sessions are active. > > The issue appears as continuous log entries on iSCSI targets: > "ctld[PID]: 192.168.1.XX: read: connection lost" every 10 seconds on each node. > > Others have experienced this, as seen in forum posts: > iSCSI Reconnecting every 10 seconds to FreeNAS solution | Proxmox Support Forum > freenas ctld: read: connection lost | TrueNAS Community This sounds like #957 [1]. A patch [2] with similar objective was merged [3] and included in Proxmox VE 8.4. Can you check whether your patch is still needed on Proxmox VE 8.4? > Changes: > - Support hostnames in portal addresses (not just IP addresses) by updating > ISCSI_TARGET_RE and session parsing regex This seems like an unrelated change that should be in its own patch, could you please re-send it separately? If you do, please review our developer docs [4], especially with regards to the CLA requirement and instructions how to use git format-patch/send-mail to submit patches (AFAICT it wasn't used here). > - Skip TCP connection tests in check_connection when active sessions exist > - Skip storage activation when sessions are already established > > This reduces iSCSI target log spam from continuous entries to only > legitimate connection issues, while maintaining monitoring functionality. Best wishes, Friedrich [1] https://bugzilla.proxmox.com/show_bug.cgi?id=957 [2] https://lore.proxmox.com/pve-devel/mailman.14.1742481496.359.pve-devel@lists.proxmox.com/ [3] https://git.proxmox.com/?p=pve-storage.git;a=commit;h=32e482a6170b3a882dc332263281b7f449066a8d [4] https://pve.proxmox.com/wiki/Developer_Documentation#Preparing_Patches > > Tested with: > - IPv4 and IPv6 portals > - Hostname based portals (like nas.example.com) > - Multiple Proxmox nodes in cluster 8.2.4 + 8.3.0 (Requires latest ISCSIPlugin.pm. taken from raw.githubusercontent.com/proxmox/pve-storage/823707a7ac99eafe345d9131d10837ebefbb9078/src/PVE/Storage/ISCSIPlugin.pm) > - TrueNAS and Linux iSCSI targets > - Can apply from /usr/share/perl5/PVE/Storage# patch -p0 < /path/to/iscsifix.patch > > --- > PVE/Storage/ISCSIPlugin.pm | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > --- ISCSIPlugin.pm.new-upstream 2025-06-19 16:24:09.220675514 -0500 > +++ ISCSIPlugin.pm 2025-06-19 16:24:42.265694074 -0500 > @@ -33,7 +33,7 @@ > } > > # Example: 192.168.122.252:3260,1 iqn.2003-01.org.linux-iscsi.proxmox-nfs.x8664:sn.00567885ba8f > -my $ISCSI_TARGET_RE = qr/^((?:$IPV4RE|\[$IPV6RE\]):\d+)\,\S+\s+(\S+)\s*$/; > +my $ISCSI_TARGET_RE = qr/^(\S+:\d+)\,\S+\s+(\S+)\s*$/; > > sub iscsi_session_list { > assert_iscsi_support(); > @@ -49,7 +49,7 @@ > my $line = shift; > # example: tcp: [1] 192.168.122.252:3260,1 iqn.2003-01.org.linux-iscsi.proxmox-nfs.x8664:sn.00567885ba8f (non-flash) > if ($line =~ > - m/^tcp:\s+\[(\S+)\]\s+((?:$IPV4RE|\[$IPV6RE\]):\d+)\,\S+\s+(\S+)\s+\S+?\s*$/ > + m/^tcp:\s+\[(\S+)\]\s+(\S+:\d+)\,\S+\s+(\S+)\s+\S+?\s*$/ > ) { > my ($session_id, $portal, $target) = ($1, $2, $3); > # there can be several sessions per target (multipath) > @@ -480,6 +480,10 @@ > sub activate_storage { > my ($class, $storeid, $scfg, $cache) = @_; > > + # Skip if session already exists > + my $existing_sessions = iscsi_session($cache, $scfg->{target}); > + return 1 if defined($existing_sessions) && scalar(@$existing_sessions) > 0; > + > return if !assert_iscsi_support(1); > > my $sessions = iscsi_session($cache, $scfg->{target}); > @@ -618,6 +622,11 @@ > sub check_connection { > my ($class, $storeid, $scfg) = @_; > my $cache = {}; > + # Check for active session first > + my $sessions = iscsi_session_list(); > + return 1 if defined($sessions->{$scfg->{target}}); > + > + # Only check portals if no active session > my $portals = iscsi_portals($scfg->{target}, $scfg->{portal}); > > for my $portal (@$portals) { > > --- > > > Regards, > Stelios Vailakakis > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel