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 18EAB1FF0AA for ; Tue, 06 Oct 2026 09:51:09 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7EC99214E0; Tue, 06 Oct 2026 09:50:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dualfroz.com; s=dkim; t=1791273054; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=z7o9+EWKW/BXy8fMy1ZjIAGFU/pN9vAjkoQY8OwXPIg=; b=KHg9NmFtzQwuTRvLqsu8pTnowvhn3LXAS8ZgoKXnhUAwUH5LBVnCBoGwCh08GXnccgM3LF /sBFDIrzNZKYRBIy+T2gc50F3YeVqOxL+W+sSKTyvncML4yYV3DiZgIcma+rMIbVTRSXtX aDxxHZYr3cojoqK09pX+nAhK+srhUVnrjhYLJjG3mshI6/kfc05Xi3ZboZ3px5sgmxWMHC 0VpzX2XRtbJ7hqN2oiTE0c+qBL98nffl82EoZtvjo64MidTgcfysqsxnIcJgRT4aICYeQS NJPo1LMpRNvGKdyLoKAM2n+azb5idc196tDMODhZUlHA6ZLobOePpTEJmJXrpQ== From: Michal Fox To: pve-devel@lists.proxmox.com Subject: [PATCH manager 1/3] fix #5990: vzdump: notes template: add pool variable Date: Tue, 6 Oct 2026 07:50:49 +0000 Message-ID: <20261006075051.7-2-me@dualfroz.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261006075051.7-1-me@dualfroz.com> References: <20261006075051.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: 0 AWL 0.154 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 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: DOC7J4YTLY5AFQDJOOEQKXDJQOWYDHBP X-Message-ID-Hash: DOC7J4YTLY5AFQDJOOEQKXDJQOWYDHBP X-MailFrom: me@dualfroz.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: 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 defe9e0a..8fdc36a0 100644 --- a/PVE/VZDump.pm +++ b/PVE/VZDump.pm @@ -111,7 +111,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|vmid)$/; + if $var !~ /^(cluster|guestname|node|pool|vmid)$/; } die "found unknown: " . join(', ', @problematic) . "\n" if scalar(@problematic); @@ -126,6 +126,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 8b99371d..2f0ec004 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -2093,7 +2093,7 @@ Ext.define('PVE.Utils', { return value.replace(/(\\\\|\\n)/g, (match) => replace[match]); }, - notesTemplateVars: ['cluster', 'guestname', 'node', 'vmid'], + notesTemplateVars: ['cluster', 'guestname', 'node', 'pool', 'vmid'], renderTags: function (tagstext, overrides) { let text = ''; -- 2.43.0