all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH v4 manager 17/25] ui: storage: add NVMe over Fabrics storage
Date: Mon, 23 Nov 2026 02:47:54 +0100	[thread overview]
Message-ID: <20261123020041.3728085-18-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20261123020041.3728085-1-t.lamprecht@proxmox.com>

Show NVMe over Fabrics storages with their subsystem in the storage
list, and add a dialog for them. The dialog lists the subsystems that a
discovery portal reports and fills in the portals of the selected one,
which can be changed. Without a discovery portal, the subsystem and its
portals can be entered as they are. As in the iSCSI dialog, the
discovery can run on another node, since the node serving the web UI
may not be allowed on the array. The node of the discovery is then
preselected as the node of the storage.

The subsystem selector builds on the iSCSI target selector, which now
lets a subclass set its store fields and sort key.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 www/manager6/Makefile              |   1 +
 www/manager6/Utils.js              |   6 ++
 www/manager6/dc/StorageView.js     |  14 ++-
 www/manager6/storage/IScsiEdit.js  |   5 +-
 www/manager6/storage/NVMeOFEdit.js | 162 +++++++++++++++++++++++++++++
 5 files changed, 184 insertions(+), 4 deletions(-)
 create mode 100644 www/manager6/storage/NVMeOFEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 1ee82e9a9..dddf17590 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -380,6 +380,7 @@ JSSRC= 							\
 	storage/LvmThinEdit.js				\
 	storage/BTRFSEdit.js				\
 	storage/NFSEdit.js				\
+	storage/NVMeOFEdit.js				\
 	storage/PBSEdit.js				\
 	storage/RBDEdit.js				\
 	storage/StatusView.js				\
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index faf621bc5..d508d0469 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -886,6 +886,12 @@ Ext.define('PVE.Utils', {
                 faIcon: 'building',
                 backups: false,
             },
+            nvmeof: {
+                name: 'NVMe over Fabrics',
+                ipanel: 'NVMeOFInputPanel',
+                faIcon: 'building',
+                backups: false,
+            },
             cephfs: {
                 name: 'CephFS',
                 ipanel: 'CephFSInputPanel',
diff --git a/www/manager6/dc/StorageView.js b/www/manager6/dc/StorageView.js
index baad3990f..6afea33ce 100644
--- a/www/manager6/dc/StorageView.js
+++ b/www/manager6/dc/StorageView.js
@@ -68,8 +68,9 @@ Ext.define(
             });
         },
 
-        // What a storage is on: the volume group or pool for the types without path or target.
-        storageLocation: function ({ type, vgname, thinpool, pool, target, path }) {
+        // What a storage is on: the volume group, pool or subsystem for the types without path or
+        // target.
+        storageLocation: function ({ type, vgname, thinpool, pool, subsysnqn, target, path }) {
             switch (type) {
                 case 'lvm':
                     return vgname;
@@ -77,6 +78,8 @@ Ext.define(
                     return vgname && thinpool ? `${vgname}/${thinpool}` : vgname;
                 case 'zfspool':
                     return pool;
+                case 'nvmeof':
+                    return subsysnqn;
                 default:
                     return target || path;
             }
@@ -208,6 +211,13 @@ Ext.define(
                     ),
                     'lun target',
                 ],
+                nvmeof: [
+                    'san',
+                    gettext(
+                        'Connect to an NVMe/TCP subsystem, to use its namespaces directly or as base of an LVM storage.',
+                    ),
+                    'nvme tcp subsystem namespace',
+                ],
                 zfs: [
                     'san',
                     gettext(
diff --git a/www/manager6/storage/IScsiEdit.js b/www/manager6/storage/IScsiEdit.js
index ad18282d8..0dd77247d 100644
--- a/www/manager6/storage/IScsiEdit.js
+++ b/www/manager6/storage/IScsiEdit.js
@@ -5,6 +5,7 @@ Ext.define('PVE.storage.IScsiScan', {
     queryParam: 'portal',
     valueField: 'target',
     displayField: 'target',
+    scanFields: ['target', 'portal'],
     matchFieldWidth: false,
     allowBlank: false,
 
@@ -56,13 +57,13 @@ Ext.define('PVE.storage.IScsiScan', {
         }
 
         let store = Ext.create('Ext.data.Store', {
-            fields: ['target', 'portal'],
+            fields: me.scanFields,
             proxy: {
                 type: 'proxmox',
                 url: `${me.apiBaseUrl}${me.nodename}${me.apiSuffix}`,
             },
         });
-        store.sort('target', 'ASC');
+        store.sort(me.valueField, 'ASC');
 
         Ext.apply(me, {
             store: store,
diff --git a/www/manager6/storage/NVMeOFEdit.js b/www/manager6/storage/NVMeOFEdit.js
new file mode 100644
index 000000000..84dd6f635
--- /dev/null
+++ b/www/manager6/storage/NVMeOFEdit.js
@@ -0,0 +1,162 @@
+Ext.define('PVE.storage.NVMeOFScan', {
+    extend: 'PVE.storage.IScsiScan',
+    alias: 'widget.pveNVMeOFScan',
+
+    valueField: 'subsysnqn',
+    displayField: 'subsysnqn',
+    scanFields: ['subsysnqn', 'portals'],
+
+    listConfig: {
+        width: 650,
+        columns: [
+            {
+                dataIndex: 'subsysnqn',
+                flex: 1,
+                renderer: Ext.htmlEncode,
+            },
+        ],
+        emptyText: PVE.Utils.renderNotFound(gettext('Subsystem')),
+    },
+
+    config: {
+        apiSuffix: '/scan/nvmeof',
+    },
+});
+
+Ext.define('PVE.storage.NVMeOFInputPanel', {
+    extend: 'PVE.panel.StorageBase',
+    mixins: ['Proxmox.Mixin.CBind'],
+
+    onlineHelp: 'storage_nvmeof',
+
+    namespaceContent: 'images',
+
+    onGetValues: function (values) {
+        let me = this;
+
+        values.content = values.namespaces ? me.namespaceContent : 'none';
+        delete values.namespaces;
+
+        return me.callParent([values]);
+    },
+
+    // a storage can be restricted to some volume types, keep its content types then
+    setValues: function (values) {
+        let me = this;
+
+        values.namespaces = PVE.Utils.contentAllows(values.content, 'vm-vol');
+        if (values.namespaces) {
+            me.namespaceContent = Ext.Array.from(values.content).join(',');
+        }
+        me.callParent([values]);
+    },
+
+    column1: [
+        {
+            xtype: 'textfield',
+            name: 'discovery-portal',
+            fieldLabel: gettext('Discovery Portal'),
+            // without discovery, the subsystem and portals can be entered as they are
+            allowBlank: true,
+            submitValue: false,
+            cbind: {
+                hidden: '{!isCreate}',
+                disabled: '{!isCreate}',
+            },
+            listeners: {
+                // The subsystem and the I/O portals of a previous discovery go at once, also its
+                // pending request. The next discovery waits until the portal is typed.
+                change: function (field, value) {
+                    let panel = field.up('inputpanel');
+                    let scan = panel.lookup('subsystemScan');
+                    scan.setPortal('');
+                    scan.setHideTrigger(true);
+                    scan.setValue('');
+                    scan.getStore().removeAll();
+                    panel.down('field[name=portals]')?.setValue('');
+                    // a pasted portal can come with spaces around it
+                    let typed = (value ?? '').trim();
+                    let portal = typed && !PVE.SANUtils.portalIncomplete(typed) ? typed : '';
+                    field.discovery ??= new Ext.util.DelayedTask();
+                    field.discovery.delay(500, () => {
+                        if (portal && !scan.destroyed) {
+                            scan.setHideTrigger(false);
+                            scan.setPortal(portal);
+                        }
+                    });
+                },
+                destroy: (field) => field.discovery?.cancel(),
+            },
+        },
+        {
+            xtype: 'checkbox',
+            name: 'namespaces',
+            boxLabel: gettext('Use namespaces directly'),
+        },
+    ],
+
+    // NQNs and portal lists are longer than a column is wide
+    columnB: [
+        {
+            cbind: {
+                xtype: (get) => (get('isCreate') ? 'pveNVMeOFScan' : 'displayfield'),
+                hideTrigger: '{isCreate}',
+            },
+            // an NQN can also be typed, if the array offers no discovery
+            editable: true,
+            notFoundIsValid: true,
+            // the list needs a discovery portal
+            expand: function () {
+                if (this.portal) {
+                    this.self.prototype.expand.call(this);
+                }
+            },
+            name: 'subsysnqn',
+            value: '',
+            fieldLabel: gettext('Subsystem'),
+            // shown when editing; an NQN wraps best at the line end, not at its first hyphen
+            fieldStyle: 'word-break: break-all;',
+            allowBlank: false,
+            reference: 'subsystemScan',
+            listeners: {
+                change: function (field, value) {
+                    let rec = field
+                        .getStore?.()
+                        .findRecord('subsysnqn', value, 0, false, true, true);
+                    if (rec) {
+                        field
+                            .up('inputpanel')
+                            .down('field[name=portals]')
+                            .setValue(rec.get('portals'));
+                    }
+                },
+                nodechanged: function (value) {
+                    this.up('inputpanel').lookup('storageNodeRestriction').setValue(value);
+                },
+            },
+        },
+        {
+            xtype: 'textfield',
+            name: 'portals',
+            fieldLabel: gettext('Portals'),
+            allowBlank: false,
+        },
+    ],
+
+    advancedColumn1: [
+        {
+            xtype: 'proxmoxintegerfield',
+            name: 'fast-io-fail-tmo',
+            fieldLabel: gettext('Fail I/O After (s)'),
+            minValue: -1,
+            emptyText: '120',
+            cbind: {
+                deleteEmpty: '{!isCreate}',
+            },
+            autoEl: {
+                tag: 'div',
+                'data-qtip': gettext('Applies to newly connected paths. -1 disables the timeout.'),
+            },
+        },
+    ],
+});




  parent reply	other threads:[~2026-11-23  2:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  1:47 [PATCH v4 storage,docs,manager 00/25] NVMe over Fabrics storage Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 01/25] diskmanage: skip SMART queries for NVMe fabric namespaces Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 02/25] diskmanage: list NVMe namespaces attached over TCP or RDMA for SAN only Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 03/25] api: disks: refuse a local wipe of a network NVMe namespace Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 04/25] nvmeof: add a storage for NVMe over Fabrics subsystems Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 05/25] d/control: bump pve-common for plain parameter error names Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 06/25] api: config: check the cluster version before the first nvmeof storage Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 07/25] lvm: allow a volume group on an NVMe over Fabrics namespace Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 08/25] api: scan: add NVMe over Fabrics discovery Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 09/25] pvesm: add a scan command for NVMe over Fabrics Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 10/25] api: san luns: attribute NVMe namespaces to storage Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 11/25] api: add node-level NVMe over Fabrics status and controller removal Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 12/25] multipath: report the NVMe host NQN of each node Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 13/25] multipath: report NVMe over Fabrics namespaces in the cluster status Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 storage 14/25] d/control: break pve-manager versions without namespace notifications Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 docs 15/25] storage: document NVMe over Fabrics storages Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 manager 16/25] report: add the NVMe over Fabrics host NQN and subsystems Thomas Lamprecht
2026-11-23  1:47 ` Thomas Lamprecht [this message]
2026-11-23  1:47 ` [PATCH v4 manager 18/25] ui: lvm: offer NVMe over Fabrics storages as base storage Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 manager 19/25] ui: storage: add a guided setup for shared LVM on NVMe over Fabrics Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 manager 20/25] ui: node san: list NVMe over Fabrics controllers Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 manager 21/25] ui: san: show the NVMe host NQN of each node Thomas Lamprecht
2026-11-23  1:47 ` [PATCH v4 manager 22/25] ui: san: show that a namespace uses native multipath Thomas Lamprecht
2026-11-23  1:48 ` [PATCH v4 manager 23/25] pvestatd: notify on NVMe over Fabrics namespaces as on multipath maps Thomas Lamprecht
2026-11-23  1:48 ` [PATCH v4 manager 24/25] ui: storage: SAN setup: ignore spaces around a typed portal Thomas Lamprecht
2026-11-23  1:48 ` [PATCH v4 manager 25/25] d/control: bump versioned dependencies for NVMe over Fabrics Thomas Lamprecht
2026-11-23 13:35 ` superseded: [PATCH v4 storage,docs,manager 00/25] 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=20261123020041.3728085-18-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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal