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 C9D2A1FF0B7 for ; Fri, 13 Nov 2026 04:24:29 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 937AC218E7; Fri, 13 Nov 2026 04:21:58 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH storage 03/17] lvm: allow a volume group on an NVMe over Fabrics namespace Date: Fri, 13 Nov 2026 04:04:31 +0100 Message-ID: <20261113030541.1591528-4-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261113030541.1591528-1-t.lamprecht@proxmox.com> References: <20261113030541.1591528-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794539148107 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.234 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: AO5LPVBLXNUTBLAXSCPCIQCDZUUQDX6M X-Message-ID-Hash: AO5LPVBLXNUTBLAXSCPCIQCDZUUQDX6M X-MailFrom: t.lamprecht@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: An LVM storage only accepts an iSCSI LUN as base volume. Accept a namespace of an NVMe over Fabrics storage too. Adding such an LVM storage connects the subsystem, waits for the namespace and creates the volume group on it, and activating it on another node connects that node first. The creation treats the namespace like any SAN LUN: it takes the cluster-wide lock of the LUN and refuses a namespace that another storage references. Signed-off-by: Thomas Lamprecht --- src/PVE/Storage/LVMPlugin.pm | 3 +-- src/test/run_san_nvme_tests.pl | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm index 4e885429..e7fb83d1 100644 --- a/src/PVE/Storage/LVMPlugin.pm +++ b/src/PVE/Storage/LVMPlugin.pm @@ -1158,9 +1158,8 @@ sub on_add_hook { my $basecfg = PVE::Storage::storage_config($cfg, $baseid, 1); die "base storage ID '$baseid' does not exist\n" if !$basecfg; - # we only support iscsi for now die "unsupported base type '$basecfg->{type}'" - if $basecfg->{type} ne 'iscsi'; + if $basecfg->{type} ne 'iscsi' && $basecfg->{type} ne 'nvmeof'; # Managed multipath requires the coalesced map, never a transient single-path PV. die "base volume '$volname' is no multipath volume of storage '$baseid'\n" diff --git a/src/test/run_san_nvme_tests.pl b/src/test/run_san_nvme_tests.pl index b1a39629..43b1219e 100755 --- a/src/test/run_san_nvme_tests.pl +++ b/src/test/run_san_nvme_tests.pl @@ -117,4 +117,21 @@ is_deeply( ); is_deeply(\@opens, [$link], 'VG creation holds the native by-id device'); +$cfg->{ids} = { fabric => { type => 'nvmeof', subsysnqn => 'nqn.test' } }; +my @activation; +$storage->mock(path => sub { $link }); +$storage->mock(activate_storage => sub { push @activation, 'storage' }); +$storage->mock(activate_volumes => sub { push @activation, 'volume' }); +$lvm->mock( + lvm_create_volume_group => sub { + is($_[0], $link, 'add hook passes native base'); + is($_[3]->{exempt}, 'data', 'add hook exempts new storage'); + }, +); +PVE::Storage::LVMPlugin->on_add_hook( + 'data', + { base => 'fabric:nvme-eui.0123456789abcdef', vgname => 'data', shared => 1 }, +); +is_deeply(\@activation, ['storage', 'volume'], 'LVM activates the NVMe base before creation'); + done_testing();