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 907AE1FF0E3 for ; Wed, 18 Nov 2026 21:31:13 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E556921A8F; Wed, 18 Nov 2026 21:28:05 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v7 manager 37/43] ui: node: san: wipe a LUN that no storage uses Date: Wed, 18 Nov 2026 21:26:20 +0100 Message-ID: <20261118202646.3017286-38-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118202646.3017286-1-t.lamprecht@proxmox.com> References: <20261118202646.3017286-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: 1795033613301 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.165 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) 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: JSARVSMGVHJK4Y746WWQP3A2FEBFYT4W X-Message-ID-Hash: JSARVSMGVHJK4Y746WWQP3A2FEBFYT4W 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: A recycled LUN often still carries a volume group or partitions from its previous use and cannot be set up again until those are gone. Let root@pam, the only user the wipe API accepts, wipe a LUN from Node > SAN. As in the disk list of a node, a separator sets the button apart from the others in the toolbar. The dialog shows what the node knows about the content of the LUN. It asks to confirm that no other host uses the LUN, as the checks of the wipe only see such a use through a storage, and for the name of the LUN. The dialog identifies the LUN by its name under /dev/disk/by-id, which names its WWID. The button is disabled for a LUN without such a name, and for a LUN that the list attributes to a storage. The list shows cached state, so the check that the node does for the wipe itself stays the one that counts. Signed-off-by: Thomas Lamprecht --- www/manager6/Makefile | 1 + www/manager6/node/SANLuns.js | 18 +++++++++ www/manager6/window/SANLunWipe.js | 64 +++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 www/manager6/window/SANLunWipe.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index a1d4d5493..14020e8db 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -137,6 +137,7 @@ JSSRC= \ window/Restore.js \ window/SafeDestroyGuest.js \ window/SafeDestroyStorage.js \ + window/SANLunWipe.js \ window/Settings.js \ window/Snapshot.js \ window/StartupEdit.js \ diff --git a/www/manager6/node/SANLuns.js b/www/manager6/node/SANLuns.js index 8d96bd126..a8b6747e6 100644 --- a/www/manager6/node/SANLuns.js +++ b/www/manager6/node/SANLuns.js @@ -160,6 +160,24 @@ Ext.define('PVE.node.SANLunList', { apiCallDone: (success) => success && reload(), }), }, + '-', + { + xtype: 'proxmoxButton', + text: gettext('Wipe'), + iconCls: 'fa fa-eraser', + disabled: true, + enableFn: (rec) => + Proxmox.UserName === 'root@pam' && + !!rec.get('by-id') && + !rec.get('used-by-storage'), + handler: (button, event, rec) => + Ext.create('PVE.window.SANLunWipe', { + node: me.nodename, + lun: rec.data, + autoShow: true, + taskDone: () => !me.destroyed && reload(), + }), + }, '->', gettext('Search') + ':', ' ', diff --git a/www/manager6/window/SANLunWipe.js b/www/manager6/window/SANLunWipe.js new file mode 100644 index 000000000..5a9d287e7 --- /dev/null +++ b/www/manager6/window/SANLunWipe.js @@ -0,0 +1,64 @@ +Ext.define('PVE.window.SANLunWipe', { + extend: 'Proxmox.window.Edit', + title: gettext('Wipe LUN'), + onlineHelp: 'storage_multipath', + width: 550, + isCreate: true, + showProgress: true, + submitText: gettext('Wipe'), + method: 'PUT', + + initComponent: function () { + let me = this; + let lun = me.lun; + let name = lun.name || lun.wwid; + me.url = `/nodes/${me.node}/disks/wipedisk`; + me.extraRequestParams = { disk: lun['by-id'] }; + me.items = [ + { + xtype: 'component', + cls: 'pmx-hint', + html: Ext.htmlEncode( + Ext.String.format( + gettext( + 'Wipe LUN {0} using node "{1}"? All data on the LUN will be lost, for every host that accesses it!', + ), + name, + me.node, + ), + ), + }, + { + xtype: 'displayfield', + fieldLabel: gettext('Used By'), + value: PVE.SANUtils.usageText(lun), + }, + { + xtype: 'displayfield', + fieldLabel: gettext('Size'), + value: Proxmox.Utils.format_size(lun.size), + }, + { + // the checks before the wipe see the storages of the cluster and the users of the LUN + // on this node, not what another host does with it + xtype: 'proxmoxcheckbox', + boxLabel: gettext('No other host uses the LUN'), + submitValue: false, + getErrors: function () { + return this.getValue() + ? [] + : [gettext('Confirm that no other host uses the LUN.')]; + }, + }, + { + xtype: 'textfield', + fieldLabel: `${gettext('Please enter the ID to confirm')} (${Ext.htmlEncode(name)})`, + labelAlign: 'top', + submitValue: false, + allowBlank: false, + validator: (value) => value === name || gettext('The ID does not match.'), + }, + ]; + me.callParent(); + }, +});