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 B4CEF1FF0B2 for ; Sun, 22 Nov 2026 02:29:01 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D4D8A218DE; Sun, 22 Nov 2026 02:27:19 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v3 manager 14/18] ui: storage: add a guided setup for shared LVM on NVMe over Fabrics Date: Sun, 22 Nov 2026 02:25:51 +0100 Message-ID: <20261122012605.1848824-15-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261122012605.1848824-1-t.lamprecht@proxmox.com> References: <20261122012605.1848824-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: 1795310772288 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.902 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) KAM_MAILER 2 Automated Mailer Tag Left in Email PROLO_LEO1 0.1 Meta Catches all Leo drug variations so far 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: RMA7UU5OWKJXPOA2QBLREQI5RH2N2QPM X-Message-ID-Hash: RMA7UU5OWKJXPOA2QBLREQI5RH2N2QPM 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: Add a guided setup for shared LVM on a namespace of an NVMe over Fabrics subsystem, with the same steps as for iSCSI. Datacenter > Storage > Add and the SAN view list it next to the other setups. It connects to a subsystem found at a discovery portal and shows the host NQNs of the nodes for the access rules of the array. The target step is shared with iSCSI, as only the storage type, its scan and the node identities differ. A reused NVMe over Fabrics storage keeps its I/O portals, which the step shows read-only. The portals that the step suggests leave out the default I/O port of such a storage, so that the discovery also tries the discovery port. Signed-off-by: Thomas Lamprecht --- www/manager6/Makefile | 2 +- www/manager6/SANUtils.js | 2 +- www/manager6/dc/SAN.js | 4 +- www/manager6/dc/StorageView.js | 5 + www/manager6/storage/wizard/LunSelect.js | 35 ++- www/manager6/storage/wizard/NodeIdentities.js | 57 +++-- .../storage/wizard/{IScsi.js => Target.js} | 232 +++++++++++++----- www/manager6/storage/wizard/Wizard.js | 60 +++-- www/manager6/window/SANLunState.js | 30 ++- 9 files changed, 298 insertions(+), 129 deletions(-) rename www/manager6/storage/wizard/{IScsi.js => Target.js} (59%) diff --git a/www/manager6/Makefile b/www/manager6/Makefile index dddf17590..f2fc80279 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -393,7 +393,7 @@ JSSRC= \ storage/wizard/Wizard.js \ storage/wizard/LunSelect.js \ storage/wizard/NodeIdentities.js \ - storage/wizard/IScsi.js \ + storage/wizard/Target.js \ storage/wizard/FibreChannel.js \ Workspace.js \ # end of JSSRC list diff --git a/www/manager6/SANUtils.js b/www/manager6/SANUtils.js index ce63fbeda..d28285d22 100644 --- a/www/manager6/SANUtils.js +++ b/www/manager6/SANUtils.js @@ -237,7 +237,7 @@ Ext.define('PVE.SANUtils', { }, openSetup: function (type, reloadCallback) { - let wizard = type === 'fc' ? 'FibreChannel' : 'IScsi'; + let wizard = { fc: 'FibreChannel', nvmeof: 'NVMeOF' }[type] ?? 'IScsi'; Ext.create(`PVE.storage.wizard.${wizard}`, { autoShow: true, reloadCallback }); }, diff --git a/www/manager6/dc/SAN.js b/www/manager6/dc/SAN.js index eea8aea65..2f624cbd2 100644 --- a/www/manager6/dc/SAN.js +++ b/www/manager6/dc/SAN.js @@ -112,7 +112,7 @@ Ext.define('PVE.dc.SANView', { autoShow: true, }); let setupItem = (type) => ({ - text: type === 'fc' ? gettext('Fibre Channel') : 'iSCSI', + text: type === 'fc' ? gettext('Fibre Channel') : PVE.Utils.format_storage_type(type), iconCls: `fa fa-fw fa-${type === 'fc' ? 'plug' : 'building'}`, disabled: !PVE.SANUtils.canSetup(type), handler: () => PVE.SANUtils.openSetup(type, reload), @@ -121,7 +121,7 @@ Ext.define('PVE.dc.SANView', { { text: gettext('Add Shared LVM'), disabled: !PVE.SANUtils.canSetup('iscsi'), - menu: [setupItem('iscsi'), setupItem('fc')], + menu: [setupItem('iscsi'), setupItem('fc'), setupItem('nvmeof')], }, { text: gettext('Multipath Overrides'), diff --git a/www/manager6/dc/StorageView.js b/www/manager6/dc/StorageView.js index 5f4f519be..4182b4c12 100644 --- a/www/manager6/dc/StorageView.js +++ b/www/manager6/dc/StorageView.js @@ -201,6 +201,11 @@ Ext.define( gettext('Set up shared LVM on a Fibre Channel LUN with multipath.'), 'san lun multipath lvm fc guided', ), + setup( + 'nvmeof', + gettext('Set up shared LVM on a namespace of an NVMe/TCP subsystem.'), + 'san nvme namespace lvm tcp guided', + ), ]; let types = { diff --git a/www/manager6/storage/wizard/LunSelect.js b/www/manager6/storage/wizard/LunSelect.js index 36a9a3804..7fd814bf0 100644 --- a/www/manager6/storage/wizard/LunSelect.js +++ b/www/manager6/storage/wizard/LunSelect.js @@ -30,10 +30,11 @@ Ext.define('PVE.storage.wizard.LunSelect', { // The scan names one target per LUN, also for a LUN reached through several. The content // listing has the LUNs of the connection, and a LUN that shows up later is listed once the // scan names the target of the connection for it. + let targetKey = wizard.wizardType === 'nvmeof' ? 'nvme-subsystem' : 'iscsi-target'; let filter = { id: 'connection', filterFn: (rec) => - rec.get('iscsi-target') === connection.target || + rec.get(targetKey) === connection.target || (me.connectionWwids ?? []).includes(rec.get('wwid')), }; me.store.addFilter(filter); @@ -45,7 +46,7 @@ Ext.define('PVE.storage.wizard.LunSelect', { success: function (response) { if (!me.destroyed) { me.connectionWwids = response.result.data - .map((entry) => entry.volid.match(/\.dm-uuid-mpath-(.+)$/)?.[1]) + .map((entry) => entry.volid.match(/(?:\.dm-uuid-mpath-|:nvme-)(.+)$/)?.[1]) .filter(Boolean); me.store.addFilter(filter); } @@ -74,7 +75,9 @@ Ext.define('PVE.storage.wizard.LunSelect', { // the setup refuses a LUN with data, so do not offer one let hasData = (row) => row.usage === 'lvm' || row.usage === 'other'; let blocked = (row) => inUse(row) || hasData(row); - let noLunsText = gettext('No LUNs found. Check connections and array access.'); + let noLunsText = me.nvme + ? gettext('No namespaces found. Check connections and array access.') + : gettext('No LUNs found. Check connections and array access.'); let updateSelection = function () { let row = me.getSelection(); me.down('#selection').setValue(row && !blocked(row) ? row.wwid : ''); @@ -91,9 +94,13 @@ Ext.define('PVE.storage.wizard.LunSelect', { xtype: 'component', cls: 'pmx-hint', margin: '0 0 10 0', - html: gettext( - 'LUNs with known data or users cannot be selected. To keep the volume group on a LUN, add it under Datacenter > Storage > Add > LVM instead. To discard the data of a LUN, stop its users on all hosts and wipe it under Node > SAN first.', - ), + html: me.nvme + ? gettext( + 'Namespaces with known data or users cannot be selected. To keep the volume group on a namespace, add it under Datacenter > Storage > Add > LVM instead. To discard the data of a namespace, stop its users on all hosts and wipe it under Node > SAN first.', + ) + : gettext( + 'LUNs with known data or users cannot be selected. To keep the volume group on a LUN, add it under Datacenter > Storage > Add > LVM instead. To discard the data of a LUN, stop its users on all hosts and wipe it under Node > SAN first.', + ), }, ...(me.rescanNote ? [ @@ -126,6 +133,7 @@ Ext.define('PVE.storage.wizard.LunSelect', { renderer: Ext.htmlEncode, }, { text: 'LUN', dataIndex: 'iscsi-lun', width: 60 }, + { text: 'NSID', dataIndex: 'nvme-nsid', width: 60 }, { text: gettext('Model'), dataIndex: 'model', @@ -144,6 +152,8 @@ Ext.define('PVE.storage.wizard.LunSelect', { dataIndex: 'multipath', width: 170, renderer: PVE.SANUtils.renderSanLunMultipath, + // native NVMe multipath needs no setup per namespace + hidden: me.nvme, }, { text: gettext('Used By'), @@ -189,9 +199,10 @@ Ext.define('PVE.storage.wizard.LunSelect', { searchchange: function (field, query) { let grid = me.down('grid'); if (grid?.rendered) { - grid.setEmptyText( - query ? gettext('No LUNs match the search.') : noLunsText, - ); + let noMatch = me.nvme + ? gettext('No namespaces match the search.') + : gettext('No LUNs match the search.'); + grid.setEmptyText(query ? noMatch : noLunsText); } }, }, @@ -206,8 +217,10 @@ Ext.define('PVE.storage.wizard.LunSelect', { let search = me.down('pveRecordSearchField'); me.on('activate', function () { search.setTargetStore(me.store); - if (me.up('window').wizardType === 'fc') { - me.down('gridcolumn[dataIndex=iscsi-lun]').hide(); + let type = me.up('window').wizardType; + me.down('gridcolumn[dataIndex=iscsi-lun]').setHidden(type !== 'iscsi'); + me.down('gridcolumn[dataIndex=nvme-nsid]').setHidden(type !== 'nvmeof'); + if (type === 'fc') { me.store.addFilter({ id: 'transport', filterFn: (rec) => ['fc', 'fcoe'].includes(rec.get('transport')), diff --git a/www/manager6/storage/wizard/NodeIdentities.js b/www/manager6/storage/wizard/NodeIdentities.js index 0a54f7ce1..36d37e164 100644 --- a/www/manager6/storage/wizard/NodeIdentities.js +++ b/www/manager6/storage/wizard/NodeIdentities.js @@ -1,32 +1,21 @@ Ext.define('pve-san-node-identity', { extend: 'Ext.data.Model', idProperty: 'node', - fields: ['node', 'state', 'iscsi-initiator-name'], + fields: ['node', 'state', 'iscsi-initiator-name', 'nvme-host-nqn'], }); -// The nodes with their initiator names, to allow them on the array, and to select the nodes that -// use the target. The node serving the web UI sets up the volume group, so it stays selected. +// The nodes with their iSCSI initiator names or NVMe host NQNs, to allow them on the array, and to +// select the nodes that use the target. The node serving the web UI sets up the volume group, so it +// stays selected. Ext.define('PVE.storage.wizard.NodeIdentities', { extend: 'Ext.grid.Panel', xtype: 'pveStorageWizardNodeIdentities', height: 220, selModel: { selType: 'checkboxmodel', mode: 'SIMPLE' }, viewConfig: { enableTextSelection: true }, - columns: [ - { text: gettext('Node'), dataIndex: 'node', width: 100, renderer: Ext.htmlEncode }, - { - text: gettext('Multipath Setup'), - dataIndex: 'state', - width: 175, - renderer: PVE.SANUtils.renderState, - }, - { - text: gettext('Initiator Name'), - dataIndex: 'iscsi-initiator-name', - flex: 1, - renderer: Ext.htmlEncode, - }, - ], + + // the identity of a node that the array allows + identity: 'iscsi-initiator-name', getSelectedNodes: function () { return this.getSelection() @@ -62,6 +51,24 @@ Ext.define('PVE.storage.wizard.NodeIdentities', { initComponent: function () { let me = this; + let nvme = me.identity === 'nvme-host-nqn'; + me.columns = [ + { text: gettext('Node'), dataIndex: 'node', width: 100, renderer: Ext.htmlEncode }, + { + text: gettext('Multipath Setup'), + dataIndex: 'state', + width: 175, + renderer: PVE.SANUtils.renderState, + // the state of multipathd, which native NVMe multipath does not use + hidden: nvme, + }, + { + text: nvme ? gettext('Host NQN') : gettext('Initiator Name'), + dataIndex: me.identity, + flex: 1, + renderer: Ext.htmlEncode, + }, + ]; me.rstore = Ext.create('Proxmox.data.UpdateStore', { storeid: 'san-wizard-identities', model: 'pve-san-node-identity', @@ -90,19 +97,23 @@ Ext.define('PVE.storage.wizard.NodeIdentities', { me.tbar = [ { xtype: 'tbtext', - text: gettext( - 'Select the nodes that will use the target and allow their initiator names on the array.', - ), + text: nvme + ? gettext( + 'Select the nodes that will use the subsystem and allow their host NQNs on the array.', + ) + : gettext( + 'Select the nodes that will use the target and allow their initiator names on the array.', + ), }, '->', { - text: gettext('Copy Initiator Names'), + text: nvme ? gettext('Copy Host NQNs') : gettext('Copy Initiator Names'), iconCls: 'fa fa-clipboard', handler: () => PVE.Utils.copyToClipboard( me .getSelection() - .map((rec) => rec.get('iscsi-initiator-name')) + .map((rec) => rec.get(me.identity)) .filter(Boolean) .join('\n'), ), diff --git a/www/manager6/storage/wizard/IScsi.js b/www/manager6/storage/wizard/Target.js similarity index 59% rename from www/manager6/storage/wizard/IScsi.js rename to www/manager6/storage/wizard/Target.js index 9ef89caef..37e2111c3 100644 --- a/www/manager6/storage/wizard/IScsi.js +++ b/www/manager6/storage/wizard/Target.js @@ -1,16 +1,21 @@ -Ext.define('PVE.storage.wizard.IScsiTarget', { +// The step of a guided setup that connects to the target of an iSCSI or the subsystem of an NVMe +// over Fabrics array, through a storage of that type. +Ext.define('PVE.storage.wizard.Target', { extend: 'Proxmox.panel.InputPanel', - xtype: 'pveStorageWizardIScsiTarget', - onlineHelp: 'storage_open_iscsi', + xtype: 'pveStorageWizardTarget', - // The iSCSI storage the target already has, which the setup uses instead of adding one. + storageType: 'iscsi', + + // The storage the target already has, which the setup uses instead of adding one. existingConnection: function () { let me = this; let target = me.down('field[name=target]').getValue(); - return me.storages?.find((entry) => entry.type === 'iscsi' && entry.target === target); + return me.storages?.find( + (entry) => entry.type === me.storageType && entry[me.targetKey] === target, + ); }, - // The ID of the iSCSI storage the setup adds, named after the storage on the LUN by default. + // The ID of the storage the setup adds, named after the storage on the LUN by default. newConnectionId: function () { let me = this; let id = me.down('field[name=storage]').getValue(); @@ -21,8 +26,9 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { // step and Next both use it, so that the note does not promise what Next then refuses. reuseConflict: function (selectedNodes) { let me = this; + let nvme = me.storageType === 'nvmeof'; let target = me.down('field[name=target]').getValue(); - let users = (me.storages ?? []).filter((entry) => entry.target === target); + let users = (me.storages ?? []).filter((entry) => entry[me.targetKey] === target); if (!users.length) { return undefined; } @@ -30,30 +36,46 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { let format = (text, ...args) => Ext.String.format(text, ...args); if (users.length !== 1) { return format( - gettext( - 'Storages {0} use this target. The setup can only reuse a target that one storage uses.', - ), + nvme + ? gettext( + 'Storages {0} use this subsystem. The setup can only reuse a subsystem that one storage uses.', + ) + : gettext( + 'Storages {0} use this target. The setup can only reuse a target that one storage uses.', + ), users.map((entry) => entry.storage).join(', '), ); - } else if (base.type !== 'iscsi') { + } else if (base.type !== me.storageType) { return format( - gettext( - 'Storage "{0}" uses this target. The setup can only reuse an iSCSI storage.', - ), + nvme + ? gettext( + 'Storage "{0}" uses this subsystem. The setup can only reuse an NVMe over Fabrics storage.', + ) + : gettext( + 'Storage "{0}" uses this target. The setup can only reuse an iSCSI storage.', + ), base.storage, ); } else if (`${base.content ?? ''}` !== 'none') { return format( - gettext( - 'Storage "{0}" uses the LUNs of this target directly. If no guest uses them, clear Use LUNs directly in its edit dialog, otherwise use another target.', - ), + nvme + ? gettext( + 'Storage "{0}" uses the namespaces of this subsystem directly. If no guest uses them, clear Use namespaces directly in its edit dialog, otherwise use another subsystem.', + ) + : gettext( + 'Storage "{0}" uses the LUNs of this target directly. If no guest uses them, clear Use LUNs directly in its edit dialog, otherwise use another target.', + ), base.storage, ); } else if (base.disable) { return format( - gettext( - 'Storage "{0}" connects to this target, but it is disabled. Enable that storage first.', - ), + nvme + ? gettext( + 'Storage "{0}" connects to this subsystem, but it is disabled. Enable that storage first.', + ) + : gettext( + 'Storage "{0}" connects to this target, but it is disabled. Enable that storage first.', + ), base.storage, ); } @@ -61,17 +83,17 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { if (baseNodes.length && !baseNodes.includes(Proxmox.NodeName)) { return format( gettext( - 'iSCSI storage "{0}" is not available on node "{1}". Open the web UI on one of its nodes.', + 'Storage "{0}" is not available on node "{1}". Open the web UI on one of its nodes.', ), base.storage, Proxmox.NodeName, ); } else if (baseNodes.length && selectedNodes.some((node) => !baseNodes.includes(node))) { return format( - gettext('iSCSI storage "{0}" is not available on all selected nodes.'), + gettext('Storage "{0}" is not available on all selected nodes.'), base.storage, ); - } else if (!base['managed-multipath']) { + } else if (!nvme && !base['managed-multipath']) { return format( gettext( 'Enable Multipath in the edit dialog of storage "{0}" before using it here.', @@ -94,6 +116,14 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { field.setReadOnly(!!existing); let id = me.down('field[name=storage]').getValue(); field.setEmptyText(id ? `${id}-base` : ''); + // a reused storage keeps its own portals + let portals = me.down('field[name=portals]'); + if (portals) { + if (existing) { + portals.setValue(existing.portals); + } + portals.setReadOnly(!!existing); + } // the nodes of a storage that the setup uses are the default selection let identities = me.down('pveStorageWizardNodeIdentities'); @@ -112,19 +142,32 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { note.setHidden(!conflict); }, - // The portals of the enabled iSCSI storages, to discover the target of another LUN through one - // of them. + // The portals of the enabled storages of the type, to discover the target of another LUN + // through one of them. An NVMe over Fabrics storage lists the I/O portals of its subsystem, + // whose default port would skip the discovery port 8009, so the suggestion leaves it out. updatePortalSuggestions: function () { let me = this; let users = new Map(); - for (const { type, portal, storage, disable } of me.storages ?? []) { - if (['iscsi', 'iscsidirect'].includes(type) && portal && !disable) { - users.set(portal, [...(users.get(portal) ?? []), storage]); + for (const { type, portal, portals, storage, disable } of me.storages ?? []) { + let list = []; + if (disable) { + continue; + } else if (me.storageType === 'nvmeof' && type === 'nvmeof') { + // as the storage splits its list + list = `${portals ?? ''}` + .split(/[\s,;]+/) + .filter(Boolean) + .map((entry) => entry.replace(/:4420$/, '')); + } else if (me.storageType === 'iscsi' && ['iscsi', 'iscsidirect'].includes(type)) { + list = portal ? [portal] : []; + } + for (const entry of new Set(list)) { + users.set(entry, [...(users.get(entry) ?? []), storage]); } } let suggestions = [...users.keys()] .sort() - .map((portal) => ({ portal, storages: users.get(portal).sort().join(', ') })); + .map((entry) => ({ portal: entry, storages: users.get(entry).sort().join(', ') })); let field = me.down('field[name=portal]'); field.getStore().setData(suggestions); field.setHideTrigger(!suggestions.length); @@ -132,13 +175,16 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { onSubmit: function () { let me = this; + let nvme = me.storageType === 'nvmeof'; let wizard = me.up('window'); let values = me.getValues(); // a disabled target field counts as valid, while the portal waits for its discovery let target = me.down('field[name=target]'); if (!values.target || target.discoveredPortal !== values.portal) { wizard.showError( - gettext('Select a target once the targets of this portal are listed.'), + nvme + ? gettext('Select a subsystem once the subsystems of this portal are listed.') + : gettext('Select a target once the targets of this portal are listed.'), ); return; } @@ -180,9 +226,13 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { // the step showed which storage it reuses, if any, which must still hold if (me.existingConnection()?.storage !== shown) { wizard.showError( - gettext( - 'The iSCSI storage of this target changed in the meantime. Check this step, then retry.', - ), + nvme + ? gettext( + 'The NVMe over Fabrics storage of this subsystem changed in the meantime. Check this step, then retry.', + ) + : gettext( + 'The iSCSI storage of this target changed in the meantime. Check this step, then retry.', + ), ); return; } @@ -210,25 +260,35 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { if (restricted.length) { nodes = (selectedNodes.length ? selectedNodes : restricted).join(','); } - connected({ storage: base.storage, target: base.target, nodes }); + connected({ storage: base.storage, target: base[me.targetKey], nodes }); return; } let params = { - type: 'iscsi', + type: me.storageType, storage: me.newConnectionId(), - portal: values.portal, - target: values.target, content: 'none', - 'managed-multipath': 1, + ...(nvme + ? // the storage configuration does not keep outer spaces, so neither may the + // copy that the cleanup compares + { subsysnqn: values.target, portals: values.portals.trim() } + : { + portal: values.portal, + target: values.target, + 'managed-multipath': 1, + }), }; if (nodes) { params.nodes = nodes; } if (params.storage === values.storage) { wizard.showError( - gettext( - 'The storage for guest disks and the iSCSI storage need different IDs. Change the iSCSI Storage ID under Advanced.', - ), + nvme + ? gettext( + 'The storage for guest disks and the NVMe over Fabrics storage need different IDs. Change the NVMe over Fabrics Storage ID under Advanced.', + ) + : gettext( + 'The storage for guest disks and the iSCSI storage need different IDs. Change the iSCSI Storage ID under Advanced.', + ), ); return; } @@ -236,9 +296,13 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { wizard.showError( Ext.htmlEncode( Ext.String.format( - gettext( - 'The ID "{0}" for the iSCSI storage is already in use. Set another one under Advanced.', - ), + nvme + ? gettext( + 'The ID "{0}" for the NVMe over Fabrics storage is already in use. Set another one under Advanced.', + ) + : gettext( + 'The ID "{0}" for the iSCSI storage is already in use. Set another one under Advanced.', + ), params.storage, ), ), @@ -258,9 +322,13 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { initComponent: function () { let me = this; + let nvme = me.storageType === 'nvmeof'; + me.targetKey = nvme ? 'subsysnqn' : 'target'; + me.onlineHelp = nvme ? 'storage_nvmeof' : 'storage_open_iscsi'; + let targetLabel = nvme ? gettext('Subsystem') : gettext('Target'); let common = PVE.panel.StorageBase.commonFields(true); // wide enough for the longest label of the step - let labelWidth = 150; + let labelWidth = nvme ? 200 : 150; let update = () => me.updateConnectionField(); let discovery = new Ext.util.DelayedTask(function () { let portal = me.down('field[name=portal]').getValue(); @@ -285,7 +353,7 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { { xtype: 'combobox', name: 'portal', - fieldLabel: gettext('Portal'), + fieldLabel: nvme ? gettext('Discovery Portal') : gettext('Portal'), labelWidth, allowBlank: false, queryMode: 'local', @@ -312,51 +380,83 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { let target = me.down('field[name=target]'); target.setValue(''); target.disable(); + // and the I/O portals of its subsystem + me.down('field[name=portals]')?.setValue(''); discovery.delay(500); }, }, }, { - xtype: 'pveIScsiScan', + xtype: nvme ? 'pveNVMeOFScan' : 'pveIScsiScan', name: 'target', - fieldLabel: gettext('Target'), + fieldLabel: targetLabel, labelWidth, disabled: true, showNodeSelector: false, nodename: Proxmox.NodeName, - listeners: { change: update }, + listeners: { + change: function (field, value) { + // the I/O portals that the discovery reported for the subsystem + let rec = + nvme && + field.getStore().findRecord('subsysnqn', value, 0, false, true, true); + if (rec) { + me.down('field[name=portals]').setValue(rec.get('portals')); + } + update(); + }, + }, listConfig: { width: 650, - emptyText: PVE.Utils.renderNotFound(gettext('iSCSI Target')), + emptyText: PVE.Utils.renderNotFound( + nvme ? gettext('Subsystem') : gettext('iSCSI Target'), + ), columns: [ { - text: gettext('Target'), - dataIndex: 'target', + text: targetLabel, + dataIndex: me.targetKey, flex: 1, renderer: Ext.htmlEncode, }, { text: gettext('Portals'), - dataIndex: 'portal', + dataIndex: nvme ? 'portals' : 'portal', width: 220, renderer: Ext.htmlEncode, }, ], }, }, + ...(nvme + ? [ + { + xtype: 'textfield', + name: 'portals', + fieldLabel: gettext('Portals'), + labelWidth, + allowBlank: false, + }, + ] + : []), { xtype: 'component', itemId: 'connectionNote', margin: '0 0 10 0', hidden: true, }, - { xtype: 'pveStorageWizardNodeIdentities', listeners: { nodeschange: update } }, + { + xtype: 'pveStorageWizardNodeIdentities', + identity: nvme ? 'nvme-host-nqn' : 'iscsi-initiator-name', + listeners: { nodeschange: update }, + }, ]; me.advancedItems = [ { ...common.id, name: 'connection', - fieldLabel: gettext('iSCSI Storage ID'), + fieldLabel: nvme + ? gettext('NVMe over Fabrics Storage ID') + : gettext('iSCSI Storage ID'), labelWidth, allowBlank: true, }, @@ -386,12 +486,15 @@ Ext.define('PVE.storage.wizard.IScsiTarget', { }, }); +// Both add the LVM storage on a volume of the connection storage, which only differs in its name. Ext.define('PVE.storage.wizard.IScsi', { extend: 'PVE.storage.wizard.SAN', wizardType: 'iscsi', createStorage: function (values, lun) { let me = this; + let nvme = me.wizardType === 'nvmeof'; + let suffix = nvme ? `:nvme-${lun.wwid}` : `.dm-uuid-mpath-${lun.wwid}`; let fail = (response) => me.showError(response.htmlStatus); Proxmox.Utils.API2Request({ url: `/nodes/${Proxmox.NodeName}/storage/${encodeURIComponent(me.connection.storage)}/content`, @@ -403,14 +506,16 @@ Ext.define('PVE.storage.wizard.IScsi', { if (me.destroyed) { return; } - let volume = response.result.data.find((entry) => - entry.volid.endsWith(`.dm-uuid-mpath-${lun.wwid}`), - ); + let volume = response.result.data.find((entry) => entry.volid.endsWith(suffix)); if (!volume) { me.showError( - gettext( - 'The selected LUN has no multipath volume yet. Check Node > SAN, then retry.', - ), + nvme + ? gettext( + 'The selected namespace is not available yet. Check Node > SAN, then retry.', + ) + : gettext( + 'The selected LUN has no multipath volume yet. Check Node > SAN, then retry.', + ), ); return; } @@ -419,3 +524,8 @@ Ext.define('PVE.storage.wizard.IScsi', { }); }, }); + +Ext.define('PVE.storage.wizard.NVMeOF', { + extend: 'PVE.storage.wizard.IScsi', + wizardType: 'nvmeof', +}); diff --git a/www/manager6/storage/wizard/Wizard.js b/www/manager6/storage/wizard/Wizard.js index 97b1405f5..d86d1cddd 100644 --- a/www/manager6/storage/wizard/Wizard.js +++ b/www/manager6/storage/wizard/Wizard.js @@ -10,8 +10,8 @@ Ext.define('PVE.storage.wizard.SAN', { type === 'fc' ? gettext('Fibre Channel') : PVE.Utils.format_storage_type(type), ), - // Removes the iSCSI storage that a closed setup added if it still has the settings of the - // setup and no storage uses it, and calls done in any case. + // Removes the iSCSI or NVMe over Fabrics storage that a closed setup added if it still has + // the settings of the setup and no storage uses it, and calls done in any case. removeAddedConnection: function (connection, done) { let id = connection.storage; // the storage list adds these to the configuration of a storage @@ -29,7 +29,7 @@ Ext.define('PVE.storage.wizard.SAN', { gettext('Error'), Ext.htmlEncode( Ext.String.format( - gettext('Could not remove iSCSI storage "{0}" of the closed setup'), + gettext('Could not remove storage "{0}" of the closed setup'), id, ), ) + `: ${response.htmlStatus}`, @@ -45,7 +45,7 @@ Ext.define('PVE.storage.wizard.SAN', { let own = storages.find((entry) => entry.storage === id); let created = connection.created; let unchanged = - own?.type === 'iscsi' && + own?.type === created.type && keys(own).join() === keys(created).join() && keys(own).every((key) => text(key, own[key]) === text(key, created[key])); let used = storages.some((entry) => `${entry.base ?? ''}`.startsWith(`${id}:`)); @@ -169,7 +169,7 @@ Ext.define('PVE.storage.wizard.SAN', { }; }, - // Removes an iSCSI storage that the setup added for a storage it did not add, then reloads. + // Removes a connection storage that the setup added for a storage it did not add, then reloads. cleanUp: function () { let me = this; let done = () => me.reloadCallback?.(); @@ -225,6 +225,7 @@ Ext.define('PVE.storage.wizard.SAN', { storage: values.storage, nodes: params.nodes, fc: me.wizardType === 'fc', + nvme: me.wizardType === 'nvmeof', autoShow: true, }); }; @@ -233,6 +234,9 @@ Ext.define('PVE.storage.wizard.SAN', { multipathSummary: function (lun) { let me = this; + if (me.wizardType === 'nvmeof') { + return PVE.SANUtils.multipathText('native'); + } // an explicit entry takes precedence, also for a LUN of the iSCSI storage if (lun.multipath === 'manual') { return PVE.SANUtils.multipathText('manual'); @@ -257,7 +261,9 @@ Ext.define('PVE.storage.wizard.SAN', { ...(connection ? [ [ - gettext('iSCSI Storage'), + me.wizardType === 'nvmeof' + ? gettext('NVMe over Fabrics Storage') + : gettext('iSCSI Storage'), connection.created ? Ext.String.format( gettext('{0}, added by this setup'), @@ -302,10 +308,15 @@ Ext.define('PVE.storage.wizard.SAN', { me.down('#action').setHtml( Ext.htmlEncode( Ext.String.format( - gettext( - // TRANSLATORS: {0} is the label of the Finish button. - '{0} creates the volume group "{1}" on this LUN and adds it as shared LVM storage "{2}".', - ), + me.wizardType === 'nvmeof' + ? gettext( + // TRANSLATORS: {0} is the label of the Finish button. + '{0} creates the volume group "{1}" on this namespace and adds it as shared LVM storage "{2}".', + ) + : gettext( + // TRANSLATORS: {0} is the label of the Finish button. + '{0} creates the volume group "{1}" on this LUN and adds it as shared LVM storage "{2}".', + ), gettext('Finish'), values.vgname, values.storage, @@ -350,10 +361,13 @@ Ext.define('PVE.storage.wizard.SAN', { initComponent: function () { let me = this; - if (!['iscsi', 'fc'].includes(me.wizardType)) { + if (!['iscsi', 'fc', 'nvmeof'].includes(me.wizardType)) { throw 'no SAN storage type specified'; } - let iscsi = me.wizardType === 'iscsi'; + // the iSCSI and NVMe over Fabrics setups connect to the array with a storage first + let target = me.wizardType !== 'fc'; + let nvme = me.wizardType === 'nvmeof'; + let onlineHelp = nvme ? 'storage_nvmeof' : 'storage_multipath'; me.subject = PVE.storage.wizard.SAN.subject(me.wizardType); me.title = Proxmox.Utils.dialog_title(me.subject, true, true); let common = PVE.panel.StorageBase.commonFields(true); @@ -369,9 +383,9 @@ Ext.define('PVE.storage.wizard.SAN', { let settings = { xtype: 'inputpanel', title: gettext('Storage'), - onlineHelp: 'storage_multipath', + onlineHelp, items: [ - ...(iscsi + ...(target ? [] : [ { @@ -389,17 +403,18 @@ Ext.define('PVE.storage.wizard.SAN', { ], advancedItems: [ vgname, - ...(iscsi + ...(target ? [] : [{ ...common.nodes, validator: PVE.storage.wizard.SAN.validateNodes }]), ], itemId: 'settings', }; me.items = [ - ...(iscsi + ...(target ? [ { - xtype: 'pveStorageWizardIScsiTarget', + xtype: 'pveStorageWizardTarget', + storageType: me.wizardType, title: gettext('Target'), itemId: 'target', }, @@ -407,11 +422,12 @@ Ext.define('PVE.storage.wizard.SAN', { : []), { xtype: 'pveStorageWizardLunSelect', - title: 'LUN', + title: nvme ? gettext('Namespace') : 'LUN', itemId: 'luns', - onlineHelp: 'storage_multipath', + nvme, + onlineHelp, // the nodes only see a newly mapped Fibre Channel LUN after a rescan - rescanNote: iscsi + rescanNote: target ? undefined : Ext.String.format( gettext( @@ -460,14 +476,14 @@ Ext.define('PVE.storage.wizard.SAN', { me.down('#settings').on('activate', followId); let tabs = me.down('#wizcontent'); tabs.on('tabchange', function (tp, tab) { - if (iscsi && tab === me.down('#luns')) { + if (target && tab === me.down('#luns')) { me.down('#back').disable(); } me.down('#submit').setText( tab === me.down('#target') ? gettext('Next') : gettext('Finish'), ); }); - if (iscsi) { + if (target) { me.down('#submit').setText(gettext('Next')); } me.on('destroy', () => !me.writing && me.cleanUp()); diff --git a/www/manager6/window/SANLunState.js b/www/manager6/window/SANLunState.js index d257e99ba..5dfce247a 100644 --- a/www/manager6/window/SANLunState.js +++ b/www/manager6/window/SANLunState.js @@ -20,8 +20,11 @@ Ext.define('PVE.window.SANLunState', { if (!me.wwid) { throw 'no LUN specified'; } + let title = me.nvme + ? gettext('Storage {0}: Namespace State') + : gettext('Storage {0}: LUN State'); me.title = me.storage - ? Ext.String.format(gettext('Storage {0}: LUN State'), me.storage) + ? Ext.String.format(title, me.storage) : Ext.String.format( gettext('LUN {0}: Paths by Node'), Ext.htmlEncode(me.name || me.wwid), @@ -56,13 +59,17 @@ Ext.define('PVE.window.SANLunState', { sortAfterUpdate: true, }); let added = Ext.String.format(gettext('Storage "{0}" was added.'), me.storage); - let missingAdvice = me.fc + let missingAdvice = me.nvme ? gettext( - 'The LUN is missing on {0}, so guests on this storage cannot run there. Check the LUN mapping and zoning on the array, then rescan the Fibre Channel hosts on {0}.', + 'The namespace is missing on {0}, so guests on this storage cannot run there. Check the host access to the subsystem on the array.', ) - : gettext( - 'The LUN is missing on {0}, so guests on this storage cannot run there. Check the LUN mapping and initiator access on the array.', - ); + : me.fc + ? gettext( + 'The LUN is missing on {0}, so guests on this storage cannot run there. Check the LUN mapping and zoning on the array, then rescan the Fibre Channel hosts on {0}.', + ) + : gettext( + 'The LUN is missing on {0}, so guests on this storage cannot run there. Check the LUN mapping and initiator access on the array.', + ); let updateAdvice = function () { if (me.destroyed || !me.storage) { return; @@ -79,7 +86,12 @@ Ext.define('PVE.window.SANLunState', { let text = [ added, waiting && - Ext.String.format(gettext('Waiting for a LUN report from: {0}.'), waiting), + Ext.String.format( + me.nvme + ? gettext('Waiting for a namespace report from: {0}.') + : gettext('Waiting for a LUN report from: {0}.'), + waiting, + ), missing && Ext.String.format(missingAdvice, missing), ]; me.down('#advice').setHtml(Ext.htmlEncode(text.filter(Boolean).join(' '))); @@ -97,7 +109,9 @@ Ext.define('PVE.window.SANLunState', { flex: 1, store, disableSelection: true, - emptyText: gettext('No node reported this LUN yet.'), + emptyText: me.nvme + ? gettext('No node reported this namespace yet.') + : gettext('No node reported this LUN yet.'), columns: [ { text: gettext('Node'),