From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 90F911FF163 for ; Thu, 12 Sep 2024 14:44:38 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 34AB130FB7; Thu, 12 Sep 2024 14:44:35 +0200 (CEST) Date: Thu, 12 Sep 2024 14:43:58 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20240813132829.117460-1-f.ebner@proxmox.com> <20240813132829.117460-23-f.ebner@proxmox.com> In-Reply-To: <20240813132829.117460-23-f.ebner@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1726144054.rz01ko794b.astroid@yuna.none> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [RFC container v2 22/25] backup: implement backup for external providers X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On August 13, 2024 3:28 pm, Fiona Ebner wrote: > The filesystem structure is made available as a directory in a > consistent manner (with details depending on the vzdump backup mode) > just like for regular backup via tar. > > The backup provider needs to back up the guest and firewall > configuration and then the filesystem structure, honoring the ID maps > (for unprivileged containers) as well as file exclusions and the > bandwidth limit. > > Signed-off-by: Fiona Ebner > --- > > Changes in v2: > * Adapt to API changes. > > src/PVE/VZDump/LXC.pm | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm > index 67d13db..0fc2a94 100644 > --- a/src/PVE/VZDump/LXC.pm > +++ b/src/PVE/VZDump/LXC.pm > @@ -373,7 +373,27 @@ sub archive { > my $userns_cmd = $task->{userns_cmd}; > my $findexcl = $self->{vzdump}->{findexcl}; > > - if ($self->{vzdump}->{opts}->{pbs}) { > + if (my $backup_provider = $self->{vzdump}->{'backup-provider'}) { > + $self->loginfo("starting external backup via " . $backup_provider->provider_name()); > + > + my ($mechanism) = $backup_provider->backup_get_mechanism($vmid, 'lxc'); > + die "mechanism '$mechanism' requested by backup provider is not supported for containers\n" > + if $mechanism ne 'directory'; > + > + my $config_file = "$tmpdir/etc/vzdump/pct.conf"; > + my $firewall_file = "$tmpdir/etc/vzdump/pct.fw"; > + > + > + my $conf = PVE::LXC::Config->load_config($vmid); > + my ($id_map, undef, undef) = PVE::LXC::parse_id_maps($conf); > + my $info = { > + directory => $snapdir, > + sources => [@sources], > + }; > + $info->{'firewall-config'} = $firewall_file if -e $firewall_file; > + $info->{'bandwidth-limit'} = $opts->{bwlimit} * 1024 if $opts->{bwlimit}; > + $backup_provider->backup_container($vmid, $config_file, $id_map, $findexcl, $info); it might be easier to hide the idmapping from the backup provider? e.g., hand it a idmapped bindmount or something like that? > + } elsif ($self->{vzdump}->{opts}->{pbs}) { > > my $param = []; > push @$param, "pct.conf:$tmpdir/etc/vzdump/pct.conf"; > -- > 2.39.2 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel