From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH storage 08/17] multipath: report the NVMe host NQN of each node
Date: Fri, 13 Nov 2026 04:04:36 +0100 [thread overview]
Message-ID: <20261113030541.1591528-9-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20261113030541.1591528-1-t.lamprecht@proxmox.com>
The status report of a node has its iSCSI initiator name, so that
the cluster-wide status shows the identities an admin needs for the
access rules of an array in one place. Add the NVMe host NQN, which
an NVMe over Fabrics target needs for the same purpose. A node
without a valid NVMe host identity reports none.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
src/PVE/API2/Multipath.pm | 2 +-
src/PVE/Multipath/Status.pm | 6 +++++-
src/test/run_multipath_api_tests.pl | 12 +++++++++++-
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/PVE/API2/Multipath.pm b/src/PVE/API2/Multipath.pm
index d5d2df9d..1d7f5707 100644
--- a/src/PVE/API2/Multipath.pm
+++ b/src/PVE/API2/Multipath.pm
@@ -86,7 +86,7 @@ my $node_schema = {
state => { type => 'string', enum => ['ok', 'unavailable', 'no-report'] },
time => { type => 'integer', optional => 1 },
map { $_ => { type => 'string', optional => 1 } }
- qw(error apply-error iscsi-initiator-name),
+ qw(error apply-error iscsi-initiator-name nvme-host-nqn),
},
};
diff --git a/src/PVE/Multipath/Status.pm b/src/PVE/Multipath/Status.pm
index 58d11f5d..9dc8e2cf 100644
--- a/src/PVE/Multipath/Status.pm
+++ b/src/PVE/Multipath/Status.pm
@@ -48,6 +48,9 @@ sub update_node_status() {
my $initiator = eval { PVE::Storage::ISCSIPlugin::read_initiator_info() };
$report->{'iscsi-initiator-name'} = $initiator->{name}
if $initiator && defined($initiator->{name});
+ require PVE::NVMeOF;
+ my $host = eval { PVE::NVMeOF::host_identity() };
+ $report->{'nvme-host-nqn'} = $host->{nqn} if $host;
eval {
die "multipath-tools is not installed\n" if !PVE::Multipath::is_supported();
die "multipathd is not running\n" if !PVE::Multipath::is_running();
@@ -134,7 +137,8 @@ sub cluster_status() {
|| !defined($report->{time})
|| time() - $report->{time} > 180;
$entry->{$_} = $report->{$_}
- for grep { defined($report->{$_}) } qw(error apply-error iscsi-initiator-name);
+ for grep { defined($report->{$_}) }
+ qw(error apply-error iscsi-initiator-name nvme-host-nqn);
$entry->{state} = defined($report->{error}) ? 'unavailable' : 'ok';
next if $entry->{state} ne 'ok';
diff --git a/src/test/run_multipath_api_tests.pl b/src/test/run_multipath_api_tests.pl
index 77ee3b9f..9bf44733 100755
--- a/src/test/run_multipath_api_tests.pl
+++ b/src/test/run_multipath_api_tests.pl
@@ -14,6 +14,7 @@ use Test::More;
use Test::MockModule;
use PVE::API2::Multipath;
use PVE::Multipath::Generator;
+use PVE::NVMeOF;
use PVE::Storage;
subtest 'explicit entries are ordinary configuration writes' => sub {
@@ -156,9 +157,12 @@ subtest 'an unconfigured node does not write drop-ins or reload' => sub {
}
my $iscsi = Test::MockModule->new('PVE::Storage::ISCSIPlugin');
$iscsi->mock(read_initiator_info => sub { {} });
+ my $nvme = Test::MockModule->new('PVE::NVMeOF');
+ $nvme->mock(host_identity => sub { die "no host identity\n" });
my $status = Test::MockModule->new('PVE::Multipath::Status');
my $report;
$status->mock(publish => sub { $report = $_[0] });
+
for my $ids ({}, { plain => { type => 'iscsi', target => 'iqn.test' } }) {
$storage->mock(config => sub { { ids => $ids } });
PVE::Multipath::Status::update_node_status();
@@ -215,15 +219,20 @@ subtest 'one entry point applies configuration and reports unavailable reasons'
$gen->mock(sync => sub { push @order, 'apply'; { error => 'reload failed' } });
$status->mock(publish => sub { push @order, 'publish'; $report = $_[0] });
$iscsi->mock(read_initiator_info => sub { { name => 'iqn.2025-01.example:node' } });
+ my $nvme = Test::MockModule->new('PVE::NVMeOF');
+ $nvme->mock(host_identity => sub { { nqn => 'nqn.2025-01.example:node', id => 'unused' } });
$mp->mock(is_supported => sub { 0 });
PVE::Multipath::Status::update_node_status();
is($report->{error}, 'multipath-tools is not installed', 'missing tools reason only');
+ is($report->{'nvme-host-nqn'}, 'nqn.2025-01.example:node', 'host NQN reported in any case');
is_deeply(\@order, [qw(apply publish)], 'single call owns ordering');
is($report->{'apply-error'}, 'reload failed', 'apply failure is separate');
+ $nvme->mock(host_identity => sub { die "no host identity\n" });
$mp->mock(is_supported => sub { 1 });
$mp->mock(is_running => sub { 0 });
PVE::Multipath::Status::update_node_status();
is($report->{error}, 'multipathd is not running', 'stopped daemon reason only');
+ ok(!exists($report->{'nvme-host-nqn'}), 'no host NQN without a valid host identity');
$mp->mock(is_running => sub { 1 });
$mp->mock(get_maps => sub { die "bad JSON\n" });
PVE::Multipath::Status::update_node_status();
@@ -278,7 +287,7 @@ subtest 'API returns final node and LUN states' => sub {
},
],
}),
- n2 => encode_json({ time => $NOW, luns => [] }),
+ n2 => encode_json({ time => $NOW, luns => [], 'nvme-host-nqn' => 'nqn.test:n2' }),
n3 => encode_json({ time => $NOW - 181, luns => [] }),
n4 => encode_json({ time => $NOW, luns => [] }),
n5 => encode_json({ time => $NOW, error => 'multipath-tools is not installed' }),
@@ -307,6 +316,7 @@ subtest 'API returns final node and LUN states' => sub {
'final node states',
);
is($res->{nodes}->{n3}->{time}, $NOW - 181, 'old report time retained');
+ is($res->{nodes}->{n2}->{'nvme-host-nqn'}, 'nqn.test:n2', 'host NQN passed on');
my $lun = $res->{luns}->[0];
is($lun->{state}, 'missing', 'worst known state');
is($lun->{nodes}->{n1}->{state}, 'optimal', 'observed healthy map');
next prev parent reply other threads:[~2026-11-13 3:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 3:04 [PATCH storage,docs,manager 00/17] NVMe over Fabrics storage Thomas Lamprecht
2026-11-13 3:04 ` [PATCH storage 01/17] diskmanage: skip SMART queries for NVMe fabric namespaces Thomas Lamprecht
2026-11-13 3:04 ` [PATCH storage 02/17] nvmeof: add a storage for NVMe over Fabrics subsystems Thomas Lamprecht
2026-11-13 3:04 ` [PATCH storage 03/17] lvm: allow a volume group on an NVMe over Fabrics namespace Thomas Lamprecht
2026-11-13 3:04 ` [PATCH storage 04/17] api: scan: add NVMe over Fabrics discovery Thomas Lamprecht
2026-11-13 3:04 ` [PATCH storage 05/17] pvesm: add a scan command for NVMe over Fabrics Thomas Lamprecht
2026-11-13 3:04 ` [PATCH storage 06/17] api: scan: san-luns: attribute NVMe namespaces to storage Thomas Lamprecht
2026-11-13 3:04 ` [PATCH storage 07/17] api: add node-level NVMe over Fabrics status and controller removal Thomas Lamprecht
2026-11-13 3:04 ` Thomas Lamprecht [this message]
2026-11-13 3:04 ` [PATCH storage 09/17] multipath: report NVMe over Fabrics namespaces in the cluster status Thomas Lamprecht
2026-11-13 3:04 ` [PATCH docs 10/17] storage: document NVMe over Fabrics storages Thomas Lamprecht
2026-11-13 3:04 ` [PATCH manager 11/17] api: nodes: mount the NVMe over Fabrics endpoints Thomas Lamprecht
2026-11-13 3:04 ` [PATCH manager 12/17] ui: storage: add NVMe over Fabrics storage Thomas Lamprecht
2026-11-13 3:04 ` [PATCH manager 13/17] ui: lvm: offer NVMe over Fabrics storages as base storage Thomas Lamprecht
2026-11-13 3:04 ` [PATCH manager 14/17] ui: dc: san: add a guided setup for shared LVM on NVMe over Fabrics Thomas Lamprecht
2026-11-13 3:04 ` [PATCH manager 15/17] ui: node: san: list NVMe over Fabrics controllers Thomas Lamprecht
2026-11-13 3:04 ` [PATCH manager 16/17] ui: dc: san: show the NVMe host NQN of each node Thomas Lamprecht
2026-11-13 3:04 ` [PATCH manager 17/17] ui: dc: san: show that a namespace uses native multipath Thomas Lamprecht
2026-11-18 20:44 ` superseded: [PATCH storage,docs,manager 00/17] NVMe over Fabrics storage Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261113030541.1591528-9-t.lamprecht@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.