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 v8 manager 39/43] ui: dc: san: add a guided setup for shared LVM on iSCSI
Date: Thu, 19 Nov 2026 20:46:44 +0100	[thread overview]
Message-ID: <20261119194655.3163258-40-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20261119194655.3163258-1-t.lamprecht@proxmox.com>

Shared LVM on an iSCSI LUN needs an iSCSI storage with multipath, the
right LUN as base volume and an LVM storage on top, in that order. Add a
guided setup for it to the SAN view: connect to the target, with the
initiator names of the nodes at hand for the access rules of the array,
select a LUN, name the volume group and storage, and confirm.

The setup starts from the SAN view and not from Datacenter > Storage >
Add, as it creates a volume group and up to two storages, while an entry
of the Add menu attaches one storage. Its menu is named Guided Setup, as
in the documentation, so that it is not taken for an Add menu or button.
Continuing from the target step creates or reuses the connection storage
before the confirm step, so the target step says so.

The menu needs Datastore.Allocate. It also needs Datastore.Audit or
Datastore.AllocateSpace, as the setup reads the storage list and the
LUNs of the connection storage.

The LUN list comes from the node serving the web UI, and offers the LUNs
of the connection storage, also one that the node reaches through
several targets. A LUN that a storage uses cannot be selected, and a
search field finds one by name, WWID or path. If the target is used by
another storage that cannot be reused, the setup names it and says why.
For a shared storage it matters whether the other nodes see the LUN as
well. So the setup ends with the state of the LUN on each node of the
storage, from the cluster-wide status. Nodes set up a new LUN with their
next status updates, so for the first minute a node without the LUN
shows as pending and not as missing.

Co-authored-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 www/manager6/Makefile                         |   5 +
 www/manager6/dc/SAN.js                        |  20 +-
 www/manager6/storage/wizard/IScsi.js          | 306 ++++++++++++++++++
 www/manager6/storage/wizard/LunSelect.js      | 204 ++++++++++++
 www/manager6/storage/wizard/NodeIdentities.js |  94 ++++++
 www/manager6/storage/wizard/Wizard.js         | 184 +++++++++++
 www/manager6/window/SANLunState.js            | 115 +++++++
 7 files changed, 927 insertions(+), 1 deletion(-)
 create mode 100644 www/manager6/storage/wizard/IScsi.js
 create mode 100644 www/manager6/storage/wizard/LunSelect.js
 create mode 100644 www/manager6/storage/wizard/NodeIdentities.js
 create mode 100644 www/manager6/storage/wizard/Wizard.js
 create mode 100644 www/manager6/window/SANLunState.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 4a6c8af72..09a02a9c4 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -137,6 +137,7 @@ JSSRC= 							\
 	window/Restore.js				\
 	window/SafeDestroyGuest.js			\
 	window/SafeDestroyStorage.js			\
+	window/SANLunState.js				\
 	window/SANLunWipe.js				\
 	window/Settings.js				\
 	window/Snapshot.js				\
@@ -385,6 +386,10 @@ JSSRC= 							\
 	storage/ZFSEdit.js				\
 	storage/ZFSPoolEdit.js				\
 	storage/ESXIEdit.js				\
+	storage/wizard/Wizard.js			\
+	storage/wizard/LunSelect.js			\
+	storage/wizard/NodeIdentities.js		\
+	storage/wizard/IScsi.js				\
 	Workspace.js					\
 # end of JSSRC list
 
diff --git a/www/manager6/dc/SAN.js b/www/manager6/dc/SAN.js
index 12afa65df..6efb48bf6 100644
--- a/www/manager6/dc/SAN.js
+++ b/www/manager6/dc/SAN.js
@@ -50,9 +50,15 @@ Ext.define('PVE.dc.SANView', {
 
     initComponent: function () {
         let me = this;
-        let caps = Ext.state.Manager.get('GuiCap').dc;
+        let allCaps = Ext.state.Manager.get('GuiCap');
+        let caps = allCaps.dc;
         let canModify = !!caps['Sys.Modify'];
         let canEdit = canModify && !!caps['Sys.Audit'];
+        // the setups also read the storage list and the LUNs of the connection storage
+        let storageCaps = allCaps.storage;
+        let canSetup =
+            !!storageCaps['Datastore.Allocate'] &&
+            !!(storageCaps['Datastore.Audit'] || storageCaps['Datastore.AllocateSpace']);
         me.rstore = Ext.create('Proxmox.data.UpdateStore', {
             storeid: 'dc-san-status',
             model: 'pve-san-status',
@@ -105,6 +111,18 @@ Ext.define('PVE.dc.SANView', {
                 autoShow: true,
                 apiCallDone: (success) => success && reload(),
             });
+        let setupItem = (wizardType, className) => ({
+            text: PVE.storage.wizard.SAN.subject(wizardType),
+            iconCls: 'fa fa-fw fa-building',
+            handler: () => Ext.create(className, { autoShow: true, reloadCallback: reload }),
+        });
+        me.tbar = [
+            {
+                text: gettext('Guided Setup'),
+                disabled: !canSetup,
+                menu: [setupItem('iscsi', 'PVE.storage.wizard.IScsi')],
+            },
+        ];
         me.items = [
             {
                 xtype: 'grid',
diff --git a/www/manager6/storage/wizard/IScsi.js b/www/manager6/storage/wizard/IScsi.js
new file mode 100644
index 000000000..f9a53793b
--- /dev/null
+++ b/www/manager6/storage/wizard/IScsi.js
@@ -0,0 +1,306 @@
+Ext.define('PVE.storage.wizard.IScsiTarget', {
+    extend: 'Proxmox.panel.InputPanel',
+    xtype: 'pveStorageWizardIScsiTarget',
+    onlineHelp: 'storage_open_iscsi',
+
+    updateConnectionField: function () {
+        let me = this;
+        let target = me.down('field[name=target]').getValue();
+        let storage = me.storages?.find(
+            (entry) => entry.type === 'iscsi' && entry.target === target,
+        );
+        let field = me.down('field[name=connection]');
+        if (storage) {
+            field.setValue(storage.storage);
+        } else if (field.readOnly) {
+            field.setValue('');
+        }
+        field.setReadOnly(!!storage);
+    },
+
+    onSubmit: function () {
+        let me = this;
+        let wizard = me.up('window');
+        let values = me.getValues();
+        let params = {
+            type: 'iscsi',
+            storage: values.connection,
+            portal: values.portal,
+            target: values.target,
+            content: 'none',
+            'managed-multipath': 1,
+        };
+        let nodes = []
+            .concat(values.nodes || [])
+            .filter(Boolean)
+            .join(',');
+        if (nodes) {
+            params.nodes = nodes;
+        }
+        let connected = function (connection) {
+            if (wizard.destroyed) {
+                return;
+            }
+            wizard.connection = connection;
+            // the step does not come back, the cluster status of its initiator names is not needed
+            me.down('pveStorageWizardNodeIdentities').rstore.stopUpdate();
+            let tabs = wizard.down('#wizcontent');
+            wizard.down('#luns').enable();
+            tabs.setActiveTab(wizard.down('#luns'));
+            me.disable();
+        };
+        let fail = (response) => wizard.showError(response.htmlStatus);
+        Proxmox.Utils.API2Request({
+            url: '/storage',
+            method: 'GET',
+            waitMsgTarget: wizard,
+            failure: fail,
+            success: function (response) {
+                if (wizard.destroyed) {
+                    return;
+                }
+                me.storages = response.result.data;
+                me.updateConnectionField();
+                let users = me.storages.filter((entry) => entry.target === values.target);
+                if (users.length) {
+                    let base = users[0];
+                    let conflict;
+                    if (users.length !== 1) {
+                        conflict = Ext.String.format(
+                            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') {
+                        conflict = Ext.String.format(
+                            gettext(
+                                'Storage "{0}" uses this target. The setup can only reuse an iSCSI storage.',
+                            ),
+                            base.storage,
+                        );
+                    } else if (`${base.content ?? ''}` !== 'none') {
+                        conflict = Ext.String.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.',
+                            ),
+                            base.storage,
+                        );
+                    }
+                    if (conflict) {
+                        wizard.showError(Ext.htmlEncode(conflict));
+                        return;
+                    }
+                    if (base.disable) {
+                        wizard.showError(
+                            Ext.htmlEncode(
+                                Ext.String.format(
+                                    gettext(
+                                        'Storage "{0}" connects to this target, but it is disabled. Enable that storage first.',
+                                    ),
+                                    base.storage,
+                                ),
+                            ),
+                        );
+                        return;
+                    }
+                    let baseNodes = base.nodes ? base.nodes.split(',') : [];
+                    if (baseNodes.length && !baseNodes.includes(Proxmox.NodeName)) {
+                        wizard.showError(
+                            Ext.htmlEncode(
+                                Ext.String.format(
+                                    gettext(
+                                        'Connection storage "{0}" is not available on node "{1}". Open the web UI on one of its nodes.',
+                                    ),
+                                    base.storage,
+                                    Proxmox.NodeName,
+                                ),
+                            ),
+                        );
+                        return;
+                    }
+                    let selectedNodes = nodes ? nodes.split(',') : baseNodes;
+                    if (
+                        baseNodes.length &&
+                        selectedNodes.some((node) => !baseNodes.includes(node))
+                    ) {
+                        wizard.showError(
+                            gettext(
+                                'The connection storage is not available on all selected nodes.',
+                            ),
+                        );
+                        return;
+                    }
+                    let connection = {
+                        storage: base.storage,
+                        target: base.target,
+                        nodes: selectedNodes.join(','),
+                    };
+                    if (!base['managed-multipath']) {
+                        wizard.showError(
+                            Ext.htmlEncode(
+                                Ext.String.format(
+                                    gettext(
+                                        'Enable Multipath in the edit dialog of storage "{0}" before using it here.',
+                                    ),
+                                    base.storage,
+                                ),
+                            ),
+                        );
+                        return;
+                    }
+                    connected(connection);
+                    return;
+                }
+                Proxmox.Utils.API2Request({
+                    url: '/storage',
+                    method: 'POST',
+                    params,
+                    waitMsgTarget: wizard,
+                    failure: fail,
+                    success: () =>
+                        connected({ storage: params.storage, target: params.target, nodes }),
+                });
+            },
+        });
+    },
+
+    initComponent: function () {
+        let me = this;
+        let common = PVE.panel.StorageBase.commonFields(true);
+        // wide enough for the longest label of the step
+        let labelWidth = 150;
+        me.items = [
+            {
+                xtype: 'textfield',
+                name: 'portal',
+                fieldLabel: gettext('Portal'),
+                labelWidth,
+                allowBlank: false,
+                listeners: {
+                    change: {
+                        buffer: 500,
+                        fn: function (field, value) {
+                            let target = me.down('field[name=target]');
+                            target.setDisabled(!value);
+                            target.setValue('');
+                            target.setPortal(value);
+                        },
+                    },
+                },
+            },
+            {
+                xtype: 'pveIScsiScan',
+                name: 'target',
+                fieldLabel: gettext('Target'),
+                labelWidth,
+                disabled: true,
+                showNodeSelector: false,
+                nodename: Proxmox.NodeName,
+                listeners: { change: () => me.updateConnectionField() },
+                listConfig: {
+                    width: 650,
+                    emptyText: PVE.Utils.renderNotFound(gettext('iSCSI Target')),
+                    columns: [
+                        {
+                            text: gettext('Target'),
+                            dataIndex: 'target',
+                            flex: 1,
+                            renderer: Ext.htmlEncode,
+                        },
+                        {
+                            text: gettext('Portals'),
+                            dataIndex: 'portal',
+                            width: 220,
+                            renderer: Ext.htmlEncode,
+                        },
+                    ],
+                },
+            },
+            {
+                ...common.id,
+                name: 'connection',
+                fieldLabel: gettext('Connection Storage'),
+                labelWidth,
+            },
+            {
+                xtype: 'component',
+                margin: '0 0 10 0',
+                html: `<span class="pmx-hint">${Ext.htmlEncode(gettext('Note:'))}</span> ${Ext.htmlEncode(
+                    Ext.String.format(
+                        gettext(
+                            // TRANSLATORS: {0} is the label of the Next button.
+                            'Pressing {0} creates or reuses the connection storage before you select a LUN.',
+                        ),
+                        gettext('Next'),
+                    ),
+                )}`,
+            },
+            { xtype: 'pveStorageWizardNodeIdentities' },
+        ];
+        me.advancedItems = [
+            {
+                ...common.nodes,
+                labelWidth,
+                validator: PVE.storage.wizard.SAN.validateNodes,
+                listeners: {
+                    change: (field, value) =>
+                        me.down('pveStorageWizardNodeIdentities').setNodes(value),
+                },
+            },
+        ];
+        me.callParent();
+        me.on('afterrender', () =>
+            Proxmox.Utils.API2Request({
+                url: '/storage',
+                method: 'GET',
+                waitMsgTarget: me,
+                failure: function (response) {
+                    if (!me.destroyed) {
+                        me.up('window').showError(response.htmlStatus);
+                    }
+                },
+                success: function (response) {
+                    if (!me.destroyed) {
+                        me.storages = response.result.data;
+                        me.updateConnectionField();
+                    }
+                },
+            }),
+        );
+    },
+});
+
+Ext.define('PVE.storage.wizard.IScsi', {
+    extend: 'PVE.storage.wizard.SAN',
+    wizardType: 'iscsi',
+
+    createStorage: function (values, lun) {
+        let me = this;
+        let fail = (response) => me.showError(response.htmlStatus);
+        Proxmox.Utils.API2Request({
+            url: `/nodes/${Proxmox.NodeName}/storage/${encodeURIComponent(me.connection.storage)}/content`,
+            method: 'GET',
+            params: { content: 'images' },
+            waitMsgTarget: me,
+            failure: fail,
+            success: function (response) {
+                if (me.destroyed) {
+                    return;
+                }
+                let volume = response.result.data.find((entry) =>
+                    entry.volid.endsWith(`.dm-uuid-mpath-${lun.wwid}`),
+                );
+                if (!volume) {
+                    me.showError(
+                        gettext(
+                            'The selected LUN has no multipath volume yet. Check Node > SAN, then retry.',
+                        ),
+                    );
+                    return;
+                }
+                me.addLVMStorage({ ...values, base: volume.volid }, fail);
+            },
+        });
+    },
+});
diff --git a/www/manager6/storage/wizard/LunSelect.js b/www/manager6/storage/wizard/LunSelect.js
new file mode 100644
index 000000000..e42779927
--- /dev/null
+++ b/www/manager6/storage/wizard/LunSelect.js
@@ -0,0 +1,204 @@
+Ext.define('PVE.storage.wizard.LunSelect', {
+    extend: 'Ext.panel.Panel',
+    xtype: 'pveStorageWizardLunSelect',
+    layout: { type: 'vbox', align: 'stretch' },
+
+    // as an input panel does, so that the wizard shows its help button for this step
+    listeners: {
+        activate: function () {
+            Ext.GlobalEvents.fireEvent('proxmoxShowHelp', this.onlineHelp);
+        },
+        deactivate: function () {
+            Ext.GlobalEvents.fireEvent('proxmoxHideHelp', this.onlineHelp);
+        },
+    },
+
+    getSelection: function () {
+        return this.down('grid').getSelection()[0]?.data;
+    },
+
+    reload: function () {
+        let me = this;
+        let wizard = me.up('window');
+        let grid = me.down('grid');
+        me.rstore.stopUpdate();
+        let connection = wizard.connection;
+        // 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 filter = {
+            id: 'connection',
+            filterFn: (rec) =>
+                rec.get('iscsi-target') === connection.target ||
+                (me.connectionWwids ?? []).includes(rec.get('wwid')),
+        };
+        me.store.addFilter(filter);
+        Proxmox.Utils.API2Request({
+            url: `/nodes/${Proxmox.NodeName}/storage/${encodeURIComponent(connection.storage)}/content`,
+            method: 'GET',
+            waitMsgTarget: grid,
+            failure: (response) => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
+            success: function (response) {
+                if (!me.destroyed) {
+                    me.connectionWwids = response.result.data
+                        .map((entry) => entry.volid.match(/\.dm-uuid-mpath-(.+)$/)?.[1])
+                        .filter(Boolean);
+                    me.store.addFilter(filter);
+                }
+            },
+            callback: function () {
+                if (!me.destroyed && wizard.down('#wizcontent').getActiveTab() === me) {
+                    me.rstore.startUpdate();
+                }
+            },
+        });
+    },
+
+    initComponent: function () {
+        let me = this;
+        me.rstore = Ext.create('Proxmox.data.UpdateStore', {
+            storeid: 'san-wizard-luns',
+            model: 'pve-san-lun',
+            interval: 3000,
+            proxy: { type: 'proxmox', url: `/api2/json/nodes/${Proxmox.NodeName}/scan/san-luns` },
+        });
+        me.store = Ext.create('Proxmox.data.DiffStore', {
+            rstore: me.rstore,
+            sortAfterUpdate: true,
+        });
+        let inUse = (row) => row['used-by-storage'];
+        let noLunsText = gettext('No LUNs found. Check connections and array access.');
+        let updateSelection = function () {
+            let row = me.getSelection();
+            me.down('#selection').setValue(row && !inUse(row) ? row.wwid : '');
+        };
+        me.items = [
+            {
+                xtype: 'textfield',
+                itemId: 'selection',
+                hidden: true,
+                allowBlank: false,
+                submitValue: false,
+            },
+            {
+                xtype: 'component',
+                cls: 'pmx-hint',
+                margin: '0 0 10 0',
+                html: gettext(
+                    'A LUN that is in use cannot be selected. A LUN with data that is no longer needed has to be wiped under Node > SAN first.',
+                ),
+            },
+            {
+                xtype: 'grid',
+                flex: 1,
+                store: me.store,
+                emptyText: noLunsText,
+                viewConfig: {
+                    enableTextSelection: true,
+                    getRowClass: (rec) => (inUse(rec.data) ? 'x-item-disabled' : ''),
+                },
+                listeners: {
+                    beforeselect: (sm, rec) => !inUse(rec.data),
+                    selectionchange: updateSelection,
+                },
+                columns: [
+                    {
+                        text: gettext('Name'),
+                        dataIndex: 'display-name',
+                        flex: 1,
+                        minWidth: 260,
+                        renderer: Ext.htmlEncode,
+                    },
+                    { text: 'LUN', dataIndex: 'iscsi-lun', width: 60 },
+                    {
+                        text: gettext('Model'),
+                        dataIndex: 'model',
+                        width: 160,
+                        renderer: (value, md, rec) =>
+                            Ext.htmlEncode([rec.get('vendor'), value].filter(Boolean).join(' ')),
+                    },
+                    {
+                        text: gettext('State'),
+                        dataIndex: 'state',
+                        width: 140,
+                        renderer: PVE.SANUtils.renderLunState,
+                    },
+                    {
+                        text: gettext('Multipath'),
+                        dataIndex: 'multipath',
+                        width: 170,
+                        renderer: PVE.SANUtils.renderSanLunMultipath,
+                    },
+                    {
+                        text: gettext('Used By'),
+                        dataIndex: 'used-by',
+                        width: 130,
+                        renderer: Ext.htmlEncode,
+                    },
+                    {
+                        text: gettext('Size'),
+                        dataIndex: 'size',
+                        width: 100,
+                        renderer: Proxmox.Utils.render_size,
+                    },
+                    {
+                        text: gettext('Device'),
+                        dataIndex: 'devpath',
+                        width: 180,
+                        hidden: true,
+                        renderer: Ext.htmlEncode,
+                    },
+                ],
+                tbar: [
+                    {
+                        text: gettext('Reload'),
+                        iconCls: 'fa fa-refresh',
+                        handler: () => me.reload(),
+                    },
+                    '->',
+                    {
+                        xtype: 'tbtext',
+                        html: Ext.htmlEncode(`${gettext('Scan node')}: ${Proxmox.NodeName}`),
+                    },
+                    ' ',
+                    gettext('Search') + ':',
+                    ' ',
+                    {
+                        xtype: 'pveRecordSearchField',
+                        emptyText: gettext('Name, WWID, Path'),
+                        searchFields: ['name', 'wwid', 'devpath', 'path-search'],
+                        listeners: {
+                            // no hit for a search is no sign of a connection problem
+                            searchchange: function (field, query) {
+                                let grid = me.down('grid');
+                                if (grid?.rendered) {
+                                    grid.setEmptyText(
+                                        query ? gettext('No LUNs match the search.') : noLunsText,
+                                    );
+                                }
+                            },
+                        },
+                    },
+                ],
+            },
+        ];
+        me.callParent();
+        Proxmox.Utils.monStoreErrors(me.down('grid'), me.rstore);
+        me.mon(me.rstore, 'load', updateSelection);
+        me.mon(me.store, 'refresh', () => PVE.SANUtils.deselectHidden(me.down('grid')));
+        let search = me.down('pveRecordSearchField');
+        me.on('activate', function () {
+            search.setTargetStore(me.store);
+            me.reload();
+        });
+        // The setup can update the selected row after this step, which the search must not hide.
+        me.on('deactivate', function () {
+            me.rstore.stopUpdate();
+            search.setTargetStore(null);
+        });
+        me.on('destroy', () => {
+            me.store.destroy();
+            me.rstore.destroy();
+        });
+    },
+});
diff --git a/www/manager6/storage/wizard/NodeIdentities.js b/www/manager6/storage/wizard/NodeIdentities.js
new file mode 100644
index 000000000..a0ef62fee
--- /dev/null
+++ b/www/manager6/storage/wizard/NodeIdentities.js
@@ -0,0 +1,94 @@
+Ext.define('pve-san-node-identity', {
+    extend: 'Ext.data.Model',
+    idProperty: 'node',
+    fields: ['node', 'state', 'iscsi-initiator-name'],
+});
+
+Ext.define('PVE.storage.wizard.NodeIdentities', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'pveStorageWizardNodeIdentities',
+    height: 220,
+    disableSelection: true,
+    viewConfig: { enableTextSelection: true },
+    columns: [
+        { text: gettext('Node'), dataIndex: 'node', width: 100, renderer: Ext.htmlEncode },
+        {
+            text: gettext('State'),
+            dataIndex: 'state',
+            width: 175,
+            renderer: PVE.SANUtils.renderState,
+        },
+        {
+            text: gettext('Initiator Name'),
+            dataIndex: 'iscsi-initiator-name',
+            flex: 1,
+            renderer: Ext.htmlEncode,
+        },
+    ],
+
+    // Lists only the given nodes, or all nodes for none, which Copy then follows.
+    setNodes: function (nodes) {
+        let me = this;
+        nodes = [].concat(nodes || []).filter(Boolean);
+        if (nodes.length) {
+            me.store.addFilter({ id: 'nodes', filterFn: (rec) => nodes.includes(rec.get('node')) });
+        } else {
+            me.store.removeFilter('nodes');
+        }
+    },
+
+    initComponent: function () {
+        let me = this;
+        me.rstore = Ext.create('Proxmox.data.UpdateStore', {
+            storeid: 'san-wizard-identities',
+            model: 'pve-san-node-identity',
+            interval: 5000,
+            proxy: {
+                type: 'proxmox',
+                url: '/api2/json/cluster/multipath/status',
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data',
+                    transform: (raw) => ({
+                        ...raw,
+                        data: Object.entries(raw.data.nodes).map(([node, report]) => ({
+                            ...report,
+                            node,
+                        })),
+                    }),
+                },
+            },
+        });
+        me.store = Ext.create('Proxmox.data.DiffStore', {
+            rstore: me.rstore,
+            sorters: ['node'],
+            sortAfterUpdate: true,
+        });
+        me.tbar = [
+            {
+                xtype: 'tbtext',
+                text: gettext('Allow the initiator names of the nodes that will use the target.'),
+            },
+            '->',
+            {
+                text: gettext('Copy Initiator Names'),
+                iconCls: 'fa fa-clipboard',
+                handler: () =>
+                    PVE.Utils.copyToClipboard(
+                        me.store
+                            .getRange()
+                            .map((rec) => rec.get('iscsi-initiator-name'))
+                            .filter(Boolean)
+                            .join('\n'),
+                    ),
+            },
+        ];
+        me.callParent();
+        Proxmox.Utils.monStoreErrors(me, me.rstore);
+        me.on('afterrender', () => me.rstore.startUpdate());
+        me.on('destroy', () => {
+            me.store.destroy();
+            me.rstore.destroy();
+        });
+    },
+});
diff --git a/www/manager6/storage/wizard/Wizard.js b/www/manager6/storage/wizard/Wizard.js
new file mode 100644
index 000000000..e0541375b
--- /dev/null
+++ b/www/manager6/storage/wizard/Wizard.js
@@ -0,0 +1,184 @@
+Ext.define('PVE.storage.wizard.SAN', {
+    extend: 'PVE.window.Wizard',
+    width: 1050,
+    height: 620,
+
+    statics: {
+        subject: (type) =>
+            Ext.String.format(gettext('LVM on {0}'), PVE.Utils.format_storage_type(type)),
+
+        // a validator of a Nodes field, which ExtJS calls with the field as this
+        validateNodes: function () {
+            let nodes = [].concat(this.getValue() || []).filter(Boolean);
+            return (
+                !nodes.length ||
+                nodes.includes(Proxmox.NodeName) ||
+                Ext.String.format(
+                    gettext('Must include node "{0}", which sets up the volume group.'),
+                    Proxmox.NodeName,
+                )
+            );
+        },
+    },
+
+    showError: function (message) {
+        if (this.destroyed) {
+            return;
+        }
+        this.down('#submit').enable();
+        Ext.Msg.alert(gettext('Error'), message);
+    },
+
+    volumeSettings: function () {
+        let me = this;
+        let value = (name) => me.down(`field[name=${name}]`).getValue();
+        return {
+            storage: value('storage'),
+            vgname: value('vgname'),
+            'snapshot-as-volume-chain': value('snapshot-as-volume-chain') ? 1 : 0,
+            nodes: me.connection.nodes,
+        };
+    },
+
+    // Adds the LVM storage with the volume settings as the last request of a setup. Only the node
+    // serving the web UI looked at the LUN, so show its state on the other nodes afterwards.
+    addLVMStorage: function (values, failure) {
+        let me = this;
+        let params = { type: 'lvm', shared: 1, content: 'images,rootdir', ...values };
+        if (!params.nodes) {
+            delete params.nodes;
+        }
+        Proxmox.Utils.API2Request({
+            url: '/storage',
+            method: 'POST',
+            params,
+            waitMsgTarget: me,
+            failure,
+            success: function () {
+                // the storage is added, also if the setup got closed in the meantime
+                if (me.destroyed) {
+                    return;
+                }
+                let wwid = me.down('#luns').getSelection().wwid;
+                me.close();
+                Ext.create('PVE.window.SANLunState', {
+                    wwid,
+                    storage: values.storage,
+                    nodes: params.nodes,
+                    autoShow: true,
+                });
+            },
+        });
+    },
+
+    multipathSummary: function (lun) {
+        // an explicit entry takes precedence, also for a LUN of the connection storage
+        if (lun.multipath === 'manual') {
+            return PVE.SANUtils.multipathText('manual');
+        }
+        return PVE.SANUtils.multipathText('storage', this.connection.storage);
+    },
+
+    updateSummary: function () {
+        let me = this;
+        let values = me.volumeSettings();
+        let lun = me.down('#luns').getSelection();
+        let rows = [
+            [gettext('Connection Storage'), me.connection.storage],
+            [gettext('Storage ID'), values.storage],
+            [gettext('Volume Group'), values.vgname],
+            ['WWID', lun.wwid],
+            [gettext('Multipath'), me.multipathSummary(lun)],
+            [gettext('Size'), Proxmox.Utils.format_size(lun.size)],
+            [gettext('Nodes'), values.nodes || gettext('All (No restrictions)')],
+            [
+                gettext('Allow Snapshots as Volume-Chain'),
+                Proxmox.Utils.format_boolean(values['snapshot-as-volume-chain']),
+            ],
+        ];
+        me.down('#summary')
+            .getStore()
+            .setData(rows.map(([key, value]) => ({ key, value })));
+    },
+
+    finish: function () {
+        let me = this;
+        let values = me.volumeSettings();
+        let lun = me.down('#luns').getSelection();
+        me.down('#submit').disable();
+        me.createStorage(values, lun);
+    },
+
+    initComponent: function () {
+        let me = this;
+        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);
+        let settings = {
+            xtype: 'inputpanel',
+            title: gettext('Volume Group'),
+            onlineHelp: 'storage_multipath',
+            items: [
+                { ...common.id, fieldLabel: gettext('Storage ID') },
+                {
+                    xtype: 'textfield',
+                    name: 'vgname',
+                    fieldLabel: gettext('Volume Group'),
+                    allowBlank: false,
+                    vtype: 'StorageId',
+                },
+                PVE.panel.StorageBase.volumeChainField(true, 'lvm'),
+            ],
+        };
+        me.items = [
+            { xtype: 'pveStorageWizardIScsiTarget', title: gettext('Target'), itemId: 'target' },
+            {
+                xtype: 'pveStorageWizardLunSelect',
+                title: 'LUN',
+                itemId: 'luns',
+                onlineHelp: 'storage_multipath',
+            },
+            settings,
+            {
+                title: gettext('Confirm'),
+                layout: 'fit',
+                items: [
+                    {
+                        xtype: 'grid',
+                        itemId: 'summary',
+                        store: { fields: ['key', 'value'] },
+                        columns: [
+                            {
+                                text: gettext('Setting'),
+                                dataIndex: 'key',
+                                width: 280,
+                                renderer: Ext.htmlEncode,
+                            },
+                            {
+                                text: gettext('Value'),
+                                dataIndex: 'value',
+                                flex: 1,
+                                cellWrap: true,
+                                renderer: Ext.htmlEncode,
+                            },
+                        ],
+                    },
+                ],
+                listeners: { activate: () => me.updateSummary() },
+                onSubmit: () => me.finish(),
+            },
+        ];
+        me.callParent();
+        let tabs = me.down('#wizcontent');
+        tabs.on('tabchange', function (tp, tab) {
+            if (tab === me.down('#luns')) {
+                me.down('#back').disable();
+            }
+            me.down('#submit').setText(
+                tab === me.down('#target') ? gettext('Next') : gettext('Finish'),
+            );
+        });
+        me.down('#submit').setText(gettext('Next'));
+        me.on('destroy', () => me.reloadCallback?.());
+    },
+});
diff --git a/www/manager6/window/SANLunState.js b/www/manager6/window/SANLunState.js
new file mode 100644
index 000000000..6d5221329
--- /dev/null
+++ b/www/manager6/window/SANLunState.js
@@ -0,0 +1,115 @@
+Ext.define('pve-san-lun-node', {
+    extend: 'Ext.data.Model',
+    idProperty: 'node',
+    fields: ['node', 'state', 'paths-active', 'paths-total', 'paths-expected'],
+});
+
+// Shows the state of the LUN of a new storage on each of its nodes, from the cluster-wide status.
+Ext.define('PVE.window.SANLunState', {
+    extend: 'Ext.window.Window',
+
+    modal: true,
+    width: 550,
+    height: 400,
+    layout: { type: 'vbox', align: 'stretch' },
+    bodyPadding: 10,
+
+    initComponent: function () {
+        let me = this;
+        if (!me.wwid || !me.storage) {
+            throw 'no LUN or storage specified';
+        }
+        me.title = Ext.String.format(gettext('Storage {0}: LUN State'), me.storage);
+        // The other nodes set up a new LUN with their next status updates.
+        let pendingUntil = Date.now() + 60000;
+        let rstore = Ext.create('Proxmox.data.UpdateStore', {
+            storeid: 'san-lun-state',
+            model: 'pve-san-lun-node',
+            interval: 3000,
+            proxy: {
+                type: 'proxmox',
+                url: '/api2/json/cluster/multipath/status',
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data',
+                    transform: function (raw) {
+                        let lun = raw.data?.luns?.find((entry) => entry.wwid === me.wwid);
+                        // other storages or entries of the LUN can expect it on more nodes
+                        let wanted = me.nodes?.split(',');
+                        let nodes = Object.entries(lun?.nodes ?? {}).filter(
+                            ([node]) => !wanted || wanted.includes(node),
+                        );
+                        return { ...raw, data: nodes.map(([node, state]) => ({ ...state, node })) };
+                    },
+                },
+            },
+        });
+        let store = Ext.create('Proxmox.data.DiffStore', {
+            rstore,
+            sorters: ['node'],
+            sortAfterUpdate: true,
+        });
+        me.items = [
+            {
+                xtype: 'component',
+                margin: '0 0 10 0',
+                html: Ext.htmlEncode(
+                    Ext.String.format(
+                        gettext(
+                            'Storage "{0}" was added. Guests on this storage cannot run on a node that stays on "Missing": check its access to the LUN on the array.',
+                        ),
+                        me.storage,
+                    ),
+                ),
+            },
+            {
+                xtype: 'grid',
+                flex: 1,
+                store,
+                disableSelection: true,
+                emptyText: gettext('No node reported this LUN yet.'),
+                columns: [
+                    {
+                        text: gettext('Node'),
+                        dataIndex: 'node',
+                        flex: 1,
+                        renderer: Ext.htmlEncode,
+                    },
+                    {
+                        text: gettext('State'),
+                        dataIndex: 'state',
+                        flex: 1,
+                        renderer: function (value, metaData, rec) {
+                            if (value === 'missing' && Date.now() < pendingUntil) {
+                                let tip = gettext(
+                                    'Not reported by the node yet; the SAN view shows that as "Missing".',
+                                );
+                                metaData.tdAttr = `data-qtip="${Ext.htmlEncode(Ext.htmlEncode(tip))}"`;
+                                return `<i class="fa fa-fw fa-spinner fa-pulse"></i> ${Ext.htmlEncode(gettext('Pending'))}`;
+                            }
+                            return PVE.SANUtils.renderState(
+                                PVE.SANUtils.lunState(value, rec.get('paths-total')),
+                            );
+                        },
+                    },
+                    {
+                        text: gettext('Active Paths'),
+                        dataIndex: 'paths-active',
+                        width: 120,
+                        renderer: (value, metaData, rec) =>
+                            value === undefined
+                                ? ''
+                                : Ext.htmlEncode(PVE.SANUtils.pathCount(rec.data)),
+                    },
+                ],
+            },
+        ];
+        me.callParent();
+        Proxmox.Utils.monStoreErrors(me.down('grid'), rstore);
+        me.on('destroy', function () {
+            store.destroy();
+            rstore.destroy();
+        });
+        rstore.startUpdate();
+    },
+});




  parent reply	other threads:[~2026-11-19 19:54 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 19:46 [PATCH v8 cluster,storage,docs,manager 00/43] SAN: cluster-wide multipath, SAN views and a guided setup for shared LVM Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 cluster 01/43] cfs: observe the multipath configuration files Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 02/43] diskmanage: collect disk transport type from lsblk Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 03/43] diskmanage: qualify NVMe over Fabrics transport Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 04/43] diskmanage: optionally include iSCSI session devices in disk enumeration Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 05/43] diskmanage: collect native NVMe multipath path state Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 06/43] iscsi: factor out session device map from device list Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 07/43] multipath: add a library around multipathd Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 08/43] diskmanage: add helper to list multipath devices Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 09/43] multipath: add a cluster-wide configuration Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 10/43] iscsi: add an option to manage storage LUNs with multipath Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 11/43] lvm: activate a missing base volume before using the volume group Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 12/43] multipath: apply the configuration on every node Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 13/43] multipath: publish per-node status Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 14/43] api: add endpoints for the cluster-wide multipath configuration Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 15/43] api: multipath: add the cluster-wide health status Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 16/43] diskmanage: look up the requested disks by name Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 17/43] diskmanage: read the udev data of all disks with one call Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 18/43] api: scan: add a SAN LUN inventory Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 19/43] pvesm: expose the " Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 20/43] api: add node-level iSCSI status Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 21/43] api: scan: name the portal of an iSCSI path Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 22/43] disks: lvm: drop unused imports Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 23/43] disks: lvm: allow volume groups on SAN LUNs and multipath maps Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 24/43] disks: lvm: refuse to destroy the volume group of a shared storage Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 25/43] disks: allow wiping a SAN LUN that no storage uses Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 storage 26/43] api: scan: report the process that has a SAN LUN open Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 docs 27/43] storage: document the cluster-wide multipath management Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 docs 28/43] storage: multipath: describe the use shown for an open LUN Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 29/43] pvestatd: apply the multipath configuration and report the node status Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 30/43] report: add the managed multipath configuration Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 31/43] api: cluster: add the multipath endpoints Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 32/43] api: nodes: expose the iSCSI status Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 33/43] ui: dc: add a SAN view Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 34/43] ui: storage: iscsi: add the multipath option Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 35/43] ui: lvm: enable shared when a base storage is selected Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 36/43] ui: node: add SAN LUNs panel Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 37/43] ui: node: san: wipe a LUN that no storage uses Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 38/43] ui: node: san: show iSCSI targets and sessions Thomas Lamprecht
2026-11-19 19:46 ` Thomas Lamprecht [this message]
2026-11-19 19:46 ` [PATCH v8 manager 40/43] ui: dc: san: add a guided setup for shared LVM on Fibre Channel Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 41/43] ui: storage: point the iSCSI and LVM add dialogs to the SAN view Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 42/43] ui: san: show the guest or process that has a LUN open Thomas Lamprecht
2026-11-19 19:46 ` [PATCH v8 manager 43/43] ui: node: san: add a column for the target or subsystem of a LUN 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=20261119194655.3163258-40-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