From 21a9ec2ad312693b0485223a9f3f9946f79c8f4e Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 12 May 2022 10:42:32 +0200 Subject: [PATCH] support pbs namespaces Signed-off-by: Wolfgang Bumiller --- PVE/QemuServer.pm | 6 ++++++ PVE/VZDump/QemuServer.pm | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index e0fc36e8..e9aa248d 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -6761,9 +6761,15 @@ sub restore_proxmox_backup_archive { # for live-restore we only want to preload the efidisk and TPM state next if $options->{live} && $virtdev ne 'efidisk0' && $virtdev ne 'tpmstate0'; + my @ns_arg; + if (defined(my $ns = $scfg->{namespace})) { + @ns_arg = ('--ns', $ns); + } + my $pbs_restore_cmd = [ '/usr/bin/pbs-restore', '--repository', $repo, + @ns_arg, $pbs_backup_name, "$d->{devname}.img.fidx", $path, diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm index 17cf7245..74295082 100644 --- a/PVE/VZDump/QemuServer.pm +++ b/PVE/VZDump/QemuServer.pm @@ -486,6 +486,9 @@ sub archive_pbs { '--backup-id', "$vmid", '--backup-time', $task->{backup_time}, ]; + if (defined(my $ns = $scfg->{namespace})) { + push @$cmd, '--ns', $ns; + } push @$cmd, "qemu-server.conf:$conffile"; push @$cmd, "fw.conf:$firewall" if -e $firewall; @@ -541,6 +544,9 @@ sub archive_pbs { devlist => $devlist, 'config-file' => $conffile, }; + if (defined(my $ns = $scfg->{namespace})) { + $params->{'backup-ns'} = $ns; + } $params->{speed} = $opts->{bwlimit}*1024 if $opts->{bwlimit}; $params->{fingerprint} = $fingerprint if defined($fingerprint); $params->{'firewall-file'} = $firewall if -e $firewall;