From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id D7B261FF150 for ; Mon, 06 Jul 2026 15:02:21 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 222F72148F; Mon, 06 Jul 2026 15:02:18 +0200 (CEST) Message-ID: <037f3b57-2137-4738-8dbc-7571c6a0c144@proxmox.com> Date: Mon, 6 Jul 2026 15:01:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH storage v3 2/2] nfs: use rpcinfo as a showmounts fallback for nfs3 To: Maximiliano Sandoval , pve-devel@lists.proxmox.com References: <20260325124646.298999-1-m.sandoval@proxmox.com> <20260325124646.298999-3-m.sandoval@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260325124646.298999-3-m.sandoval@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: 1783342897246 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.040 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) 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: BZXSY2XGPCCKJLET4SA6MI5E6S6QOKQ5 X-Message-ID-Hash: BZXSY2XGPCCKJLET4SA6MI5E6S6QOKQ5 X-MailFrom: f.ebner@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: Am 25.03.26 um 1:46 PM schrieb Maximiliano Sandoval: > The check_connection call must succeed in order for the NFS storage to > be activated. In a setup in which the NFS server does not list exports > and which only supports NFSv3 this would result in the storage not being > usable (not without manually mounting the NFS share and using a > Directory storage instead). We add a fallback check with rpcinfo for > this case. > > The rpcinfo check was replaced with showmounts in f8b0d82fe. At the time Typo: s/showmounts/showmount/ > the rationale was that rpcinfo did not have support for ipv6 > connections, which does not hold anymore. > > In order to not break compatibility with setups that already activate > correctly, we add a rpcinfo check as a fallback for NFSv3-only setups > only after the showmounts command fails. Typo: s/showmounts/showmount/ > > Potential pitfalls: > - Some NFSv3 servers might only support UDP [RFC 1813] Also relevant for switching to only using rpcinfo. Could you extend the TODO PVE 10 comment with this pitfall? > - The two timeouts add up to 20 seconds Is the timeout for the first command hit in case the server does not list exports? Or does the command fail differently? If it's the former case, it would be nice to avoid that, since a 10 second delay on every activate_storage() is still bad from a user perspective. Were there good reasons for the customer's server not to list the exports? If not, we could also just document the requirement for NFSv3? > - Some NFS servers might not have rpcbind as described in acff89540 AFAIK only NFSv4 ones [0], and that's why we have the tcp_ping() fallback there. [0]: "The following section only applies to NFSv3 implementations that require the rpcbind service for backward compatibility." - from https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/s2-nfs-methodology-portmap > > [RFC 1813]: https://datatracker.ietf.org/doc/html/rfc1813#section-2.3 > > Signed-off-by: Maximiliano Sandoval > --- > src/PVE/Storage/NFSPlugin.pm | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/src/PVE/Storage/NFSPlugin.pm b/src/PVE/Storage/NFSPlugin.pm > index 56dbd9ec..78f27c33 100644 > --- a/src/PVE/Storage/NFSPlugin.pm > +++ b/src/PVE/Storage/NFSPlugin.pm > @@ -198,6 +198,7 @@ sub check_connection { > # no exports are listed > $cmd = $nfs_get_rpcinfo_command->($server, '4'); > } else { > + # TODO PVE 10 Consider switching to rpcinfo altogether. Nit: could use the usual format: # FIXME: MAJOR VERSION: ... > $cmd = ['/sbin/showmount', '--no-headers', '--exports', $server]; > } > > @@ -214,6 +215,12 @@ sub check_connection { > return 0 if $port == 0; > > return PVE::Network::tcp_ping($server, $port, 2); > + } else { > + $cmd = $nfs_get_rpcinfo_command->($server, '3'); > + eval { > + run_command($cmd, timeout => 10, outfunc => sub { }, errfunc => sub { }); > + }; > + return 1 if !$@; > } > return 0; > }