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 4B2741FF0E3 for ; Wed, 18 Nov 2026 21:43:12 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id AD27C217B2; Wed, 18 Nov 2026 21:43:10 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v2 storage 03/17] lvm: allow a volume group on an NVMe over Fabrics namespace Date: Wed, 18 Nov 2026 21:42:22 +0100 Message-ID: <20261118204302.3100813-4-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118204302.3100813-1-t.lamprecht@proxmox.com> References: <20261118204302.3100813-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: 1795034587265 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.162 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: XLA32HFTD7XH5JWHL4VA4BES6NEEEOA2 X-Message-ID-Hash: XLA32HFTD7XH5JWHL4VA4BES6NEEEOA2 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 b9f7f34d..cccf3bb8 100644 --- a/src/PVE/Storage/LVMPlugin.pm +++ b/src/PVE/Storage/LVMPlugin.pm @@ -1194,9 +1194,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 or a partition of it, never a transient # single-path PV. diff --git a/src/test/run_san_nvme_tests.pl b/src/test/run_san_nvme_tests.pl index c74b638a..7df849e3 100755 --- a/src/test/run_san_nvme_tests.pl +++ b/src/test/run_san_nvme_tests.pl @@ -133,4 +133,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();