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 3058A1FF066 for ; Tue, 24 Nov 2026 09:26:41 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9C1722163C; Tue, 24 Nov 2026 09:26:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dualfroz.com; s=dkim; t=1795503502; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=QbdG79y/nvo99goeskOiCWLfQg/2C8h+XOP9TEz5yZ8=; b=y2DLm8sMnB9HlGmmZmodo/o1MlFQQQr0jTn7CHgMyeilh4PBOG8hjZ3PvBQqZTT2g2IDof 1tvu0Ld0o0pvR8K61wNaHK7a1S7vxOPkuSv2tw0q/n3njR5VqC6yny8NblMeSDLwFYarjH QrV5wxEgVke3yA6u/tRe6syIQ+ci4jAg52WQqSy431MENw6+IpBVsdDovi48t2jrCI16sW 9SHrdABHwrHs430C3AhfBCVP99NkSSjL9Is57gFEl2EjAftPGpniUtG7jSsqeyMhGxYVLs lvBIvbd4R4FCrSuejG+4+6kxIYWBWzfGXNu2c/S8Efqv02G/O5xVy1OPwR8iYQ== From: Michal Fox To: pve-devel@lists.proxmox.com Subject: [PATCH manager v2 1/3] fix #5990: vzdump: notes template: add pool variable Date: Tue, 24 Nov 2026 06:58:18 +0000 Message-ID: <20261124065820.7-2-me@dualfroz.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261124065820.7-1-me@dualfroz.com> References: <20261124065820.7-1-me@dualfroz.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-SPAM-LEVEL: Spam detection results: 1 AWL 0.000 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS SPF_FAIL 0.919 SPF: sender does not match SPF record (fail) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record X-MailFrom: me@dualfroz.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: VUZVZ35D4LKKZTTV4SEMHC2M4QFG7FQD X-Message-ID-Hash: VUZVZ35D4LKKZTTV4SEMHC2M4QFG7FQD X-Mailman-Approved-At: Tue, 24 Nov 2026 09:26:36 +0100 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Backups of guests from different teams or users often end up on the same storage, and the resource pool of the guest is a common way to tell them apart. But the pool is not part of the backup, and the VMID alone is not enough to find out later where a backup came from, as VMIDs can be reused. Add a {{pool}} variable to the notes template, which is replaced with the resource pool the guest is a member of at the time of the backup, or with an empty string if it is not in any pool, and list it in the hint of the backup dialogs. Signed-off-by: Michal Fox --- Tested by generating notes with a mocked user.cfg for a guest in a pool and one without, and by checking the hint in the backup dialogs. For guests that are not in any pool, the variable is replaced with an empty string, as there is no obvious placeholder like for the cluster name. Happy to change that if something else is preferred. PVE/VZDump.pm | 3 ++- www/manager6/Utils.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm index 5b9397c..a62fd93 100644 --- a/PVE/VZDump.pm +++ b/PVE/VZDump.pm @@ -112,7 +112,7 @@ my $verify_notes_template = sub { while ($template =~ /\{\{([^\s{}]+)\}\}/g) { my $var = $1; push @problematic, "variable '$var' at char " . (pos($template) - length($var)) - if $var !~ /^(cluster|guestname|node|uid|vmid)$/; + if $var !~ /^(cluster|guestname|node|pool|uid|vmid)$/; } die "found unknown: " . join(', ', @problematic) . "\n" if scalar(@problematic); @@ -127,6 +127,7 @@ my $generate_notes = sub { cluster => PVE::Cluster::get_clinfo()->{cluster}->{name} // 'standalone node', guestname => $task->{hostname} // "VM $task->{vmid}", # is always set for CTs node => PVE::INotify::nodename(), + pool => cfs_read_file('user.cfg')->{vms}->{ $task->{vmid} } // '', vmid => $task->{vmid}, }; diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index 3c0b030..3213b23 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -2150,7 +2150,7 @@ Ext.define('PVE.Utils', { return value.replace(/(\\\\|\\n)/g, (match) => replace[match]); }, - notesTemplateVars: ['cluster', 'guestname', 'node', 'uid', 'vmid'], + notesTemplateVars: ['cluster', 'guestname', 'node', 'pool', 'uid', 'vmid'], renderTags: function (tagstext, overrides) { let text = ''; -- 2.43.0