From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 4E62F1FF0C0 for ; Wed, 18 Nov 2026 07:57:34 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E746421A1D; Wed, 18 Nov 2026 07:54:13 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v6 manager 36/42] ui: node: san: wipe a LUN that no storage uses Date: Wed, 18 Nov 2026 07:52:53 +0100 Message-ID: <20261118065302.3033937-37-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118065302.3033937-1-t.lamprecht@proxmox.com> References: <20261118065302.3033937-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: 1794984789201 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.179 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: GP6SDHNRZG3ECSM6FJB2TKLDB3ZERA5X X-Message-ID-Hash: GP6SDHNRZG3ECSM6FJB2TKLDB3ZERA5X 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. The dialog shows what the node knows about the content of the LUN and asks for its name as confirmation. The button is disabled 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 | 15 +++++++++ www/manager6/window/SANLunWipe.js | 52 +++++++++++++++++++++++++++++++ 3 files changed, 68 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 c5b22f72f..c26f9c6f3 100644 --- a/www/manager6/node/SANLuns.js +++ b/www/manager6/node/SANLuns.js @@ -158,6 +158,21 @@ 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('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..ecf7c592b --- /dev/null +++ b/www/manager6/window/SANLunWipe.js @@ -0,0 +1,52 @@ +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'] || lun.devpath }; + 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), + }, + { + 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(); + }, +});