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 v4 manager 3/5] close #4513: ui: backup job: add tab for advanced options
Date: Tue, 16 Apr 2024 14:09:53 +0200	[thread overview]
Message-ID: <20240416120957.75269-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20240416120957.75269-1-f.ebner@proxmox.com>

pigz is not exposed, because it only works after manually installing
the pigz package.

ionice is not exposed, because it only works in combination with the
BFQ scheduler and even then not in all cases (only affects the
compressor when doing snapshot/suspend mode backup of a VM).

The pbs-entries-max performance option is not exposed. It is rather
niche and hard to understand. It serves as an escape hatch for
rare/extreme cases.

These can still be added with appropriate notes if there is enough
user demand.

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

Changes in v4:
  * rename to advanced

 www/manager6/Makefile                       |   1 +
 www/manager6/dc/Backup.js                   |  12 ++
 www/manager6/panel/BackupAdvancedOptions.js | 142 ++++++++++++++++++++
 3 files changed, 155 insertions(+)
 create mode 100644 www/manager6/panel/BackupAdvancedOptions.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index c756cae6..0f1779d5 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -97,6 +97,7 @@ JSSRC= 							\
 	grid/Replication.js				\
 	grid/ResourceGrid.js				\
 	panel/ConfigPanel.js				\
+	panel/BackupAdvancedOptions.js			\
 	panel/BackupJobPrune.js				\
 	panel/HealthWidget.js				\
 	panel/IPSet.js					\
diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index 70903bdc..aaa319f4 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -196,6 +196,11 @@ Ext.define('PVE.dc.BackupEdit', {
 				PVE.Utils.unEscapeNotesTemplate(data['notes-template']);
 			}
 
+			if (data.performance) {
+			    Object.assign(data, data.performance);
+			    delete data.performance;
+			}
+
 			view.setValues(data);
 		    },
 		});
@@ -466,6 +471,13 @@ Ext.define('PVE.dc.BackupEdit', {
 			},
 		    ],
 		},
+		{
+		    xtype: 'pveBackupAdvancedOptionsPanel',
+		    title: gettext('Advanced'),
+		    cbind: {
+			isCreate: '{isCreate}',
+		    },
+		},
 	    ],
 	},
     ],
diff --git a/www/manager6/panel/BackupAdvancedOptions.js b/www/manager6/panel/BackupAdvancedOptions.js
new file mode 100644
index 00000000..4d74ba3d
--- /dev/null
+++ b/www/manager6/panel/BackupAdvancedOptions.js
@@ -0,0 +1,142 @@
+/*
+ * Input panel for advanced backup options intended to be used as part of an edit/create window.
+ */
+Ext.define('PVE.panel.BackupAdvancedOptions', {
+    extend: 'Proxmox.panel.InputPanel',
+    xtype: 'pveBackupAdvancedOptionsPanel',
+    mixins: ['Proxmox.Mixin.CBind'],
+
+    cbindData: function() {
+	let me = this;
+	me.isCreate = !!me.isCreate;
+	return {};
+    },
+
+    onGetValues: function(formValues) {
+	if (this.needMask) { // isMasked() may not yet be true if not rendered once
+	    return {};
+	}
+
+	let options = { 'delete': [] };
+
+	let performance = {};
+	let performanceOptions = ['max-workers', 'pbs-entries-max'];
+
+	for (const [key, value] of Object.entries(formValues)) {
+	    if (performanceOptions.includes(key)) {
+		performance[key] = value;
+	    // deleteEmpty is not currently implemented for pveBandwidthField
+	    } else if (key === 'bwlimit' && value === '') {
+		options.delete.push('bwlimit');
+	    } else if (key === 'delete') {
+		if (Array.isArray(value)) {
+		    value.filter(opt => !performanceOptions.includes(opt)).forEach(
+			opt => options.delete.push(opt),
+		    );
+		} else if (!performanceOptions.includes(formValues.delete)) {
+		    options.delete.push(value);
+		}
+	    } else {
+		options[key] = value;
+	    }
+	}
+
+	if (Object.keys(performance).length > 0) {
+	    options.performance = PVE.Parser.printPropertyString(performance);
+	} else {
+	    options.delete.push('performance');
+	}
+
+	if (this.isCreate) {
+	    delete options.delete;
+	}
+
+	return options;
+    },
+
+    column1: [
+	{
+	    xtype: 'pveBandwidthField',
+	    name: 'bwlimit',
+	    fieldLabel: gettext('Bandwidth Limit'),
+	    emptyText: gettext('use fallback'),
+	    backendUnit: 'KiB',
+	    allowZero: true,
+	    emptyValue: '',
+	    autoEl: {
+		tag: 'div',
+		'data-qtip': Ext.String.format(gettext('Use {0} for unlimited'), 0),
+	    },
+	},
+	{
+	    xtype: 'proxmoxintegerfield',
+	    name: 'zstd',
+	    fieldLabel: Ext.String.format(gettext('{0} Threads'), 'Zstd'),
+	    fieldStyle: 'text-align: right',
+	    emptyText: gettext('use fallback'),
+	    minValue: 0,
+	    cbind: {
+		deleteEmpty: '{!isCreate}',
+	    },
+	    autoEl: {
+		tag: 'div',
+		'data-qtip': gettext('With 0, half of the available cores are used'),
+	    },
+	},
+	{
+	    xtype: 'proxmoxintegerfield',
+	    name: 'max-workers',
+	    minValue: 1,
+	    maxValue: 256,
+	    fieldLabel: gettext('VM Workers'),
+	    fieldStyle: 'text-align: right',
+	    emptyText: gettext('use fallback'),
+	    cbind: {
+		deleteEmpty: '{!isCreate}',
+	    },
+	},
+	{
+	    // It's part of the 'performance' property string, so have a field to preserve the
+	    // value, but don't expose it. It's a rather niche setting and difficult to
+	    // convey/understand what it does.
+	    xtype: 'proxmoxintegerfield',
+	    name: 'pbs-entries-max',
+	    hidden: true,
+	    fieldLabel: 'TODO',
+	    fieldStyle: 'text-align: right',
+	    emptyText: gettext('use fallback'),
+	    cbind: {
+		deleteEmpty: '{!isCreate}',
+	    },
+	},
+    ],
+
+    column2: [
+	{
+	    xtype: 'displayfield',
+	    value: gettext('Limit I/O bandwidth'),
+	},
+	{
+	    xtype: 'displayfield',
+	    value: `${gettext('Threads used for zstd compression')} (${gettext('non-PBS')})`,
+	},
+	{
+	    xtype: 'displayfield',
+	    value: `${gettext('I/O workers in the QEMU process')} (${gettext('VM only')})`,
+	},
+	{
+	    xtype: 'displayfield',
+	    value: 'TODO',
+	    hidden: true, // see definition of pbs-entries-max field
+	},
+    ],
+
+    columnB: [
+	{
+	    xtype: 'component',
+	    userCls: 'pmx-hint',
+	    padding: '5 1',
+	    html: gettext("Note that vzdump.conf is used as a fallback"),
+	},
+    ],
+});
-- 
2.39.2





  parent reply	other threads:[~2024-04-16 12:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 12:09 [pve-devel] [PATCH-SERIES v4 manager/docs] close #4513: add advanced tab for backup jobs and improve performance fallback/default Fiona Ebner
2024-04-16 12:09 ` [pve-devel] [PATCH v4 manager 1/5] vzdump: actually honor schema defaults for performance Fiona Ebner
2024-04-16 12:09 ` [pve-devel] [PATCH v4 manager 2/5] vzdump: use per-property fallback for performance settings Fiona Ebner
2024-04-16 12:09 ` Fiona Ebner [this message]
2024-04-16 12:09 ` [pve-devel] [PATCH v4 manager 4/5] ui: backup job: disable zstd thread count field when zstd isn't used Fiona Ebner
2024-04-16 12:09 ` [pve-devel] [PATCH v4 manager 5/5] ui: backup job: move repeat-missed option to advanced tab Fiona Ebner
2024-04-16 12:09 ` [pve-devel] [PATCH v4 docs 1/2] backup: update information about performance settings Fiona Ebner
2024-04-16 12:09 ` [pve-devel] [PATCH v4 docs 2/2] backup: clarify where repeat-missed option can be found now Fiona Ebner
2024-04-17 14:06 ` [pve-devel] applied-series: [PATCH-SERIES v4 manager/docs] close #4513: add advanced tab for backup jobs and improve performance fallback/default 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=20240416120957.75269-4-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