all lists on 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 v3 8/8] ui: restore: enable safeguarding of mount point volumes by default
Date: Fri, 23 Jan 2026 15:34:28 +0100	[thread overview]
Message-ID: <20260123143454.150800-9-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260123143454.150800-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>
---

Changes in v3:
* Slightly improve tooltip.

NOTE: dependency bump for pve-container is needed!
NOTE: better viewed as a word-based diff

 www/manager6/window/Restore.js | 98 ++++++++++++++++++++--------------
 1 file changed, 58 insertions(+), 40 deletions(-)

diff --git a/www/manager6/window/Restore.js b/www/manager6/window/Restore.js
index e8d8de4e..841a5db8 100644
--- a/www/manager6/window/Restore.js
+++ b/www/manager6/window/Restore.js
@@ -50,6 +50,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] ?? '') !== '') {
@@ -98,7 +101,6 @@ Ext.define('PVE.window.Restore', {
             if (view.vmid) {
                 if (view.vmtype === 'lxc') {
                     confirmMsg += `. ${gettext('This will permanently erase current CT data.')}`;
-                    confirmMsg += `<br>${gettext('Mount point volumes are also erased.')}`;
                 } else {
                     confirmMsg += `. ${gettext('This will permanently erase current VM data.')}`;
                 }
@@ -256,47 +258,63 @@ Ext.define('PVE.window.Restore', {
         ];
 
         if (me.vmtype === 'lxc') {
-            items.push({
-                xtype: 'radiogroup',
-                fieldLabel: gettext('Privilege Level'),
-                reference: 'noVNCScalingGroup',
-                height: '15px', // renders faster with value assigned
-                layout: {
-                    type: 'hbox',
-                    algin: 'stretch',
+            items.push(
+                {
+                    xtype: 'radiogroup',
+                    fieldLabel: gettext('Privilege Level'),
+                    reference: 'noVNCScalingGroup',
+                    height: '15px', // renders faster with value assigned
+                    layout: {
+                        type: 'hbox',
+                        algin: 'stretch',
+                    },
+                    autoEl: {
+                        tag: 'div',
+                        'data-qtip': gettext(
+                            'Choose if you want to keep or override the privilege level of the restored Container.',
+                        ),
+                    },
+                    items: [
+                        {
+                            xtype: 'radiofield',
+                            name: 'unprivileged',
+                            inputValue: 'keep',
+                            boxLabel: gettext('From Backup'),
+                            flex: 1,
+                            checked: true,
+                        },
+                        {
+                            xtype: 'radiofield',
+                            name: 'unprivileged',
+                            inputValue: '1',
+                            boxLabel: gettext('Unprivileged'),
+                            flex: 1,
+                        },
+                        {
+                            xtype: 'radiofield',
+                            name: 'unprivileged',
+                            inputValue: '0',
+                            boxLabel: gettext('Privileged'),
+                            flex: 1,
+                            //margin: '0 0 0 10',
+                        },
+                    ],
                 },
-                autoEl: {
-                    tag: 'div',
-                    'data-qtip': gettext(
-                        'Choose if you want to keep or override the privilege level of the restored Container.',
-                    ),
+                {
+                    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 Disk' entries.",
+                        ),
+                    },
                 },
-                items: [
-                    {
-                        xtype: 'radiofield',
-                        name: 'unprivileged',
-                        inputValue: 'keep',
-                        boxLabel: gettext('From Backup'),
-                        flex: 1,
-                        checked: true,
-                    },
-                    {
-                        xtype: 'radiofield',
-                        name: 'unprivileged',
-                        inputValue: '1',
-                        boxLabel: gettext('Unprivileged'),
-                        flex: 1,
-                    },
-                    {
-                        xtype: 'radiofield',
-                        name: 'unprivileged',
-                        inputValue: '0',
-                        boxLabel: gettext('Privileged'),
-                        flex: 1,
-                        //margin: '0 0 0 10',
-                    },
-                ],
-            });
+            );
         } else if (me.vmtype === 'qemu') {
             items.push(
                 {
-- 
2.47.3



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


      parent reply	other threads:[~2026-01-23 14:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 14:34 [pve-devel] [PATCH-SERIES container/manager v3 0/8] api: restore: allow keeping not backed-up volumes Fiona Ebner
2026-01-23 14:34 ` [pve-devel] [PATCH container v3 1/8] api: create: move delayed_mp_param variable closer to usage Fiona Ebner
2026-01-23 14:34 ` [pve-devel] [PATCH container v3 2/8] api: create: reduce scope for $mp_param variable Fiona Ebner
2026-01-23 14:34 ` [pve-devel] [PATCH container v3 3/8] api: create: factor out create_ct_determine_mp_param helper Fiona Ebner
2026-01-23 14:34 ` [pve-devel] [PATCH container v3 4/8] run make tidy Fiona Ebner
2026-01-23 14:34 ` [pve-devel] [PATCH container v3 5/8] api: create: create_ct_determine_mp_param: improve code style Fiona Ebner
2026-01-23 14:34 ` [pve-devel] [PATCH container v3 6/8] api: create: get rid of $storage_only_mode variable Fiona Ebner
2026-01-23 14:34 ` [pve-devel] [PATCH container v3 7/8] api: restore: allow keeping not backed-up volumes Fiona Ebner
2026-01-23 14:34 ` 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=20260123143454.150800-9-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 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