From bddd17922857f591f7704a1d3c8449155d9a3177 Mon Sep 17 00:00:00 2001 From: Michal Fox Date: Sat, 3 Oct 2026 01:13:05 +0200 Subject: [PATCH] fix #5990: vzdump: notes template: add pool variable 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 --- 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 defe9e0..8fdc36a 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 8b99371..2f0ec00 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 = '';