From: Dietmar Maurer <dietmar@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [RFC pve-storage 03/27] diskmanage: qualify NVMe over fabrics transport
Date: Fri, 31 Jul 2026 12:21:32 +0200 [thread overview]
Message-ID: <20260731102156.3947857-4-dietmar@proxmox.com> (raw)
In-Reply-To: <20260731102156.3947857-1-dietmar@proxmox.com>
lsblk reports plain 'nvme' for fabrics attached namespaces, so
clients cannot tell local PCIe drives from shared SAN namespaces.
Read the transport from the namespace controller, or from any
controller of the subsystem when the namespace belongs to a
subsystem due to native NVMe multipath, and report nvme-fc,
nvme-tcp, nvme-rdma or nvme-loop instead.
This lets clients like the SAN LUN scan or the local storage
creation dialogs decide which namespaces are suitable, instead of
hiding fabrics attached devices server side.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
---
src/PVE/Diskmanage.pm | 27 +++++++++++++++
src/test/disk_tests/multipath/disklist | 2 ++
.../multipath/disklist_expected.json | 33 +++++++++++++++++++
src/test/disk_tests/multipath/lsblk | 14 ++++++++
.../disk_tests/multipath/nvme8n1/device/model | 1 +
.../multipath/nvme8n1/device/transport | 1 +
.../multipath/nvme8n1/queue/rotational | 1 +
src/test/disk_tests/multipath/nvme8n1/size | 1 +
src/test/disk_tests/multipath/nvme8n1_udevadm | 14 ++++++++
.../disk_tests/multipath/nvme9n1/device/model | 1 +
.../multipath/nvme9n1/device/transport | 1 +
.../multipath/nvme9n1/device/vendor | 1 +
.../multipath/nvme9n1/queue/rotational | 1 +
src/test/disk_tests/multipath/nvme9n1/size | 1 +
src/test/disk_tests/multipath/nvme9n1_udevadm | 12 +++++++
15 files changed, 111 insertions(+)
create mode 100644 src/test/disk_tests/multipath/nvme8n1/device/model
create mode 100644 src/test/disk_tests/multipath/nvme8n1/device/transport
create mode 100644 src/test/disk_tests/multipath/nvme8n1/queue/rotational
create mode 100644 src/test/disk_tests/multipath/nvme8n1/size
create mode 100644 src/test/disk_tests/multipath/nvme8n1_udevadm
create mode 100644 src/test/disk_tests/multipath/nvme9n1/device/model
create mode 100644 src/test/disk_tests/multipath/nvme9n1/device/transport
create mode 100644 src/test/disk_tests/multipath/nvme9n1/device/vendor
create mode 100644 src/test/disk_tests/multipath/nvme9n1/queue/rotational
create mode 100644 src/test/disk_tests/multipath/nvme9n1/size
create mode 100644 src/test/disk_tests/multipath/nvme9n1_udevadm
diff --git a/src/PVE/Diskmanage.pm b/src/PVE/Diskmanage.pm
index ed5181f..b006ec3 100644
--- a/src/PVE/Diskmanage.pm
+++ b/src/PVE/Diskmanage.pm
@@ -485,6 +485,26 @@ sub is_iscsi {
return 0;
}
+# Returns the NVMe transport (pcie, fc, tcp, rdma, loop) of a namespace, either directly from
+# its controller, or from any controller of its subsystem for native NVMe multipath setups.
+sub get_nvme_transport {
+ my ($sysdir) = @_;
+
+ my $transport = file_read_firstline("$sysdir/device/transport");
+ return $transport if defined($transport);
+
+ dir_glob_foreach(
+ "$sysdir/device",
+ 'nvme\d+',
+ sub {
+ my ($controller) = @_;
+ $transport //= file_read_firstline("$sysdir/device/$controller/transport");
+ },
+ );
+
+ return $transport;
+}
+
my sub is_ssdlike {
my ($type) = @_;
return $type eq 'ssd' || $type eq 'nvme';
@@ -577,6 +597,9 @@ sub get_disks {
# we do not want iscsi devices
return if is_iscsi($sysdir);
+ my $nvme_transport;
+ $nvme_transport = get_nvme_transport($sysdir) if $dev =~ m/^nvme/;
+
my $sysdata = get_sysdir_info($sysdir);
return if !defined($sysdata);
@@ -628,7 +651,11 @@ sub get_disks {
wearout => $wearout,
};
+ # lsblk reports plain 'nvme' for fabrics attached namespaces
my $transport = $lsblk_info->{$devpath}->{tran};
+ if (defined($nvme_transport) && $nvme_transport ne 'pcie') {
+ $transport = "nvme-$nvme_transport";
+ }
$disklist->{$dev}->{transport} = $transport if defined($transport);
$disklist->{$dev}->{mounted} = 1 if exists $mounted->{$devpath};
diff --git a/src/test/disk_tests/multipath/disklist b/src/test/disk_tests/multipath/disklist
index 9293589..f759ba9 100644
--- a/src/test/disk_tests/multipath/disklist
+++ b/src/test/disk_tests/multipath/disklist
@@ -7,3 +7,5 @@ dm-1
dm-2
dm-3
dm-4
+nvme8n1
+nvme9n1
diff --git a/src/test/disk_tests/multipath/disklist_expected.json b/src/test/disk_tests/multipath/disklist_expected.json
index a8e74fa..ec44296 100644
--- a/src/test/disk_tests/multipath/disklist_expected.json
+++ b/src/test/disk_tests/multipath/disklist_expected.json
@@ -70,5 +70,38 @@
"by_id_link": "/dev/disk/by-id/scsi-36001405000000000000000000000000d",
"transport": "fc",
"used": "Device Mapper"
+ },
+ "nvme8n1": {
+ "devpath": "/dev/nvme8n1",
+ "size": 10737418240,
+ "vendor": "unknown",
+ "model": "FCMODEL",
+ "serial": "FCNVME1",
+ "wwn": "uuid.20000000-0000-0000-0000-000000000001",
+ "gpt": 0,
+ "rpm": 0,
+ "type": "nvme",
+ "health": "UNKNOWN",
+ "wearout": "N/A",
+ "osdid": -1,
+ "osdid-list": null,
+ "by_id_link": "/dev/disk/by-id/nvme-FCMODEL_FCNVME1",
+ "transport": "nvme-fc"
+ },
+ "nvme9n1": {
+ "devpath": "/dev/nvme9n1",
+ "size": 10737418240,
+ "vendor": "FABVEND",
+ "model": "FABRICS CTRL",
+ "serial": "FAB1",
+ "wwn": "uuid.10000000-0000-0000-0000-000000000001",
+ "gpt": 0,
+ "rpm": 0,
+ "type": "nvme",
+ "health": "UNKNOWN",
+ "wearout": "N/A",
+ "osdid": -1,
+ "osdid-list": null,
+ "transport": "nvme-tcp"
}
}
diff --git a/src/test/disk_tests/multipath/lsblk b/src/test/disk_tests/multipath/lsblk
index 91f7457..dfc1ae1 100644
--- a/src/test/disk_tests/multipath/lsblk
+++ b/src/test/disk_tests/multipath/lsblk
@@ -58,6 +58,20 @@
"fstype": null,
"tran": null,
"pttype": null
+ },
+ {
+ "path": "/dev/nvme8n1",
+ "parttype": null,
+ "fstype": null,
+ "tran": "nvme",
+ "pttype": null
+ },
+ {
+ "path": "/dev/nvme9n1",
+ "parttype": null,
+ "fstype": null,
+ "tran": "nvme",
+ "pttype": null
}
]
}
diff --git a/src/test/disk_tests/multipath/nvme8n1/device/model b/src/test/disk_tests/multipath/nvme8n1/device/model
new file mode 100644
index 0000000..1aac689
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme8n1/device/model
@@ -0,0 +1 @@
+FCMODEL
\ No newline at end of file
diff --git a/src/test/disk_tests/multipath/nvme8n1/device/transport b/src/test/disk_tests/multipath/nvme8n1/device/transport
new file mode 100644
index 0000000..8b517d0
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme8n1/device/transport
@@ -0,0 +1 @@
+fc
\ No newline at end of file
diff --git a/src/test/disk_tests/multipath/nvme8n1/queue/rotational b/src/test/disk_tests/multipath/nvme8n1/queue/rotational
new file mode 100644
index 0000000..c227083
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme8n1/queue/rotational
@@ -0,0 +1 @@
+0
\ No newline at end of file
diff --git a/src/test/disk_tests/multipath/nvme8n1/size b/src/test/disk_tests/multipath/nvme8n1/size
new file mode 100644
index 0000000..8280959
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme8n1/size
@@ -0,0 +1 @@
+20971520
\ No newline at end of file
diff --git a/src/test/disk_tests/multipath/nvme8n1_udevadm b/src/test/disk_tests/multipath/nvme8n1_udevadm
new file mode 100644
index 0000000..d0cd5ea
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme8n1_udevadm
@@ -0,0 +1,14 @@
+P: /devices/virtual/nvme-subsystem/nvme-subsys8/nvme8n1
+N: nvme8n1
+S: disk/by-id/nvme-FCMODEL_FCNVME1
+E: DEVLINKS=/dev/disk/by-id/nvme-FCMODEL_FCNVME1
+E: DEVNAME=/dev/nvme8n1
+E: DEVPATH=/devices/virtual/nvme-subsystem/nvme-subsys8/nvme8n1
+E: DEVTYPE=disk
+E: ID_MODEL=FCMODEL
+E: ID_SERIAL=FCNVME_1
+E: ID_SERIAL_SHORT=FCNVME1
+E: ID_WWN=uuid.20000000-0000-0000-0000-000000000001
+E: MAJOR=259
+E: MINOR=1
+E: SUBSYSTEM=block
diff --git a/src/test/disk_tests/multipath/nvme9n1/device/model b/src/test/disk_tests/multipath/nvme9n1/device/model
new file mode 100644
index 0000000..aa0287c
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme9n1/device/model
@@ -0,0 +1 @@
+FABMODEL
\ No newline at end of file
diff --git a/src/test/disk_tests/multipath/nvme9n1/device/transport b/src/test/disk_tests/multipath/nvme9n1/device/transport
new file mode 100644
index 0000000..f5483db
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme9n1/device/transport
@@ -0,0 +1 @@
+tcp
\ No newline at end of file
diff --git a/src/test/disk_tests/multipath/nvme9n1/device/vendor b/src/test/disk_tests/multipath/nvme9n1/device/vendor
new file mode 100644
index 0000000..cdc6ddf
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme9n1/device/vendor
@@ -0,0 +1 @@
+FABVEND
\ No newline at end of file
diff --git a/src/test/disk_tests/multipath/nvme9n1/queue/rotational b/src/test/disk_tests/multipath/nvme9n1/queue/rotational
new file mode 100644
index 0000000..c227083
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme9n1/queue/rotational
@@ -0,0 +1 @@
+0
\ No newline at end of file
diff --git a/src/test/disk_tests/multipath/nvme9n1/size b/src/test/disk_tests/multipath/nvme9n1/size
new file mode 100644
index 0000000..8280959
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme9n1/size
@@ -0,0 +1 @@
+20971520
\ No newline at end of file
diff --git a/src/test/disk_tests/multipath/nvme9n1_udevadm b/src/test/disk_tests/multipath/nvme9n1_udevadm
new file mode 100644
index 0000000..b6d13cc
--- /dev/null
+++ b/src/test/disk_tests/multipath/nvme9n1_udevadm
@@ -0,0 +1,12 @@
+P: /devices/virtual/nvme-subsystem/nvme-subsys9/nvme9n1
+N: nvme9n1
+E: DEVNAME=/dev/nvme9n1
+E: DEVPATH=/devices/virtual/nvme-subsystem/nvme-subsys9/nvme9n1
+E: DEVTYPE=disk
+E: ID_MODEL=FABRICS CTRL
+E: ID_SERIAL=FABRICS_1
+E: ID_SERIAL_SHORT=FAB1
+E: ID_WWN=uuid.10000000-0000-0000-0000-000000000001
+E: MAJOR=259
+E: MINOR=0
+E: SUBSYSTEM=block
--
2.47.3
next prev parent reply other threads:[~2026-07-31 10:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 10:21 [RFC pve-storage/proxmox-widget-toolkit/pve-manager 00/27] add guided remote storage setup and SAN visibility Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 01/27] diskmanage: collect disk transport type from lsblk Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 02/27] diskmanage: add helper to list multipath devices Dietmar Maurer
2026-07-31 10:21 ` Dietmar Maurer [this message]
2026-07-31 10:21 ` [RFC pve-storage 04/27] disks: list: add include-remote parameter Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 05/27] diskmanage: include iSCSI session devices in disk enumeration Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 06/27] diskmanage: link multipath member disks to their map device Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 07/27] iscsi: factor out session device map from device list Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 08/27] api: scan: add san-luns method listing SAN LUN candidates Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 09/27] disks: lvm: allow creating volume groups on multipath devices Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 10/27] diskmanage: add helper querying multipath path state Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 11/27] diskmanage: add helper querying NVMe native " Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 12/27] api: scan: san-luns: report " Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 13/27] iscsi plugin: list sessions of all transports and capture transport Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-storage 14/27] api: add node-level iSCSI initiator target and session API Dietmar Maurer
2026-07-31 10:21 ` [RFC proxmox-widget-toolkit 15/27] disk selectors: allow opting into remote devices Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 16/27] ui: storage: allow switching the scan node of the NFS/CIFS scan combos Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 17/27] ui: storage: add guided remote storage wizard with NFS support Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 18/27] ui: storage wizard: add SMB/CIFS support Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 19/27] ui: storage wizard: add iSCSI support Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 20/27] ui: storage wizard: add FC-attached SAN (shared LVM) support Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 21/27] ui: storage wizard: add ZFS over iSCSI support Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 22/27] ui: dc: storage: add remote storage wizard entry to the add menu Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 23/27] ui: node: add SAN LUNs panel Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 24/27] ui: san luns: show multipath path state Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 25/27] api: nodes: add iSCSI initiator API endpoint Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 26/27] pvenode: add iscsi commands Dietmar Maurer
2026-07-31 10:21 ` [RFC pve-manager 27/27] ui: san luns: show iSCSI targets and sessions Dietmar Maurer
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=20260731102156.3947857-4-dietmar@proxmox.com \
--to=dietmar@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.