public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v2] ui: restore: enable safeguarding of mount point volumes by default
Date: Tue, 11 Feb 2025 12:20:45 +0100	[thread overview]
Message-ID: <20250211112045.37214-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250211112045.37214-1-f.ebner@proxmox.com>

Same rationale as in pve-manager commit 5f855ccf ("ui: restore:
improve warning for restoring container with same ID"): it's
surprising to (new) users that all owned mount point volumes are
erased upon container restore, even those that are not currently
selected for backup. This is different from VM restore, where volumes
attached at drives not present in the backup will be kept around as
unused volumes.

Opt-in by default to the new option to change this behavior.

Remove the special message printed regarding removal of mount point
volumes to avoid confusion/complexity. With the checkbox for
safeguarding being present, attention is already directed towards this
behavior. And since the checkbox is enabled by default, one needs to
explicitly opt-out for not backed-up mount points. For backed-up mount
points, it should be clear that they are overwritten by the restore,
since the confirm dialog already states "This will permanently erase
current CT data".

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

New in v2.

Dependency bump for pve-container is needed.

 www/manager6/window/Restore.js | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/www/manager6/window/Restore.js b/www/manager6/window/Restore.js
index 6efe1313..3d759d6a 100644
--- a/www/manager6/window/Restore.js
+++ b/www/manager6/window/Restore.js
@@ -47,6 +47,9 @@ Ext.define('PVE.window.Restore', {
 	    if (values.storage) {
 		params.storage = values.storage;
 	    }
+	    if (values['restore-safeguard-mp-volumes']) {
+		params['restore-safeguard-mp-volumes'] = 1;
+	    }
 
 	    ['bwlimit', 'cores', 'name', 'memory', 'sockets'].forEach(opt => {
 		if ((values[opt] ?? '') !== '') {
@@ -96,9 +99,6 @@ Ext.define('PVE.window.Restore', {
 		    gettext('This will permanently erase current {0} data.'),
 		    view.vmtype === 'lxc' ? 'CT' : 'VM',
 		)}`;
-		if (view.vmtype === 'lxc') {
-		    confirmMsg += `<br>${gettext('Mount point volumes are also erased.')}`;
-		}
 		Ext.Msg.confirm(gettext('Confirm'), confirmMsg, function(btn) {
 		    if (btn === 'yes') {
 			executeRestore();
@@ -278,6 +278,18 @@ Ext.define('PVE.window.Restore', {
 			},
 		    ],
 		},
+		{
+		    xtype: 'proxmoxcheckbox',
+		    name: 'restore-safeguard-mp-volumes',
+		    itemId: 'restoreSafeguardMpVolumes',
+		    fieldLabel: gettext('Safeguard Mount Point Volumes'),
+		    flex: 1,
+		    checked: true,
+		    autoEl: {
+			tag: 'div',
+			'data-qtip': gettext("Preserve mount point volumes that are not included in the backup as 'unused'."),
+		    },
+		},
 	    );
 	} else if (me.vmtype === 'qemu') {
 	    items.push({
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


      reply	other threads:[~2025-02-11 11:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 11:20 [pve-devel] [PATCH container v2] api: restore: allow keeping not backed-up volumes Fiona Ebner
2025-02-11 11:20 ` Fiona Ebner [this message]

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=20250211112045.37214-2-f.ebner@proxmox.com \
    --to=f.ebner@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal