From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <s.reiter@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 57E8F706C8
 for <pve-devel@lists.proxmox.com>; Mon,  7 Jun 2021 11:29:35 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 55756F2CC
 for <pve-devel@lists.proxmox.com>; Mon,  7 Jun 2021 11:29:35 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 5743AF293
 for <pve-devel@lists.proxmox.com>; Mon,  7 Jun 2021 11:29:31 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2EF414292A
 for <pve-devel@lists.proxmox.com>; Mon,  7 Jun 2021 11:29:31 +0200 (CEST)
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 =?UTF-8?Q?Fabian_Gr=c3=bcnbichler?= <f.gruenbichler@proxmox.com>
References: <20210604094748.3383339-1-f.gruenbichler@proxmox.com>
 <20210604094748.3383339-7-f.gruenbichler@proxmox.com>
From: Stefan Reiter <s.reiter@proxmox.com>
Message-ID: <a9ba9653-c1c8-d0fc-c8db-c5f4c7614c8f@proxmox.com>
Date: Mon, 7 Jun 2021 11:29:25 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
MIME-Version: 1.0
In-Reply-To: <20210604094748.3383339-7-f.gruenbichler@proxmox.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.958 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 NICE_REPLY_A           -0.001 Looks like a legit reply (A)
 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 qemu-server 6/6] template: start VM for VMA
 backup
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Mon, 07 Jun 2021 09:29:35 -0000

On 6/4/21 11:47 AM, Fabian Grünbichler wrote:
> since using 'vma create ..' no longer works with immutable/read-only
> base volumes.

Why that? It shouldn't matter to vma if the base is read-only? Though I 
do see that in vma.c we don't tell QEMU that it should open the block 
backend read-only...

Anyway, I do personally think that just starting a VM is also a good way 
of doing this, though as you say, for templates it would make a lot of 
sense to restrict the VM to use less resources.

> 
> first hunk drops a leftover variable from when we did the same change to
> the PBS code path.
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> ---
> this mimics what we already did for PBS, we still might want to think
> about limiting memory for the started VM for template backups which
> can't be resumed into operation anyway..
> 
>   PVE/VZDump/QemuServer.pm | 20 ++++----------------
>   1 file changed, 4 insertions(+), 16 deletions(-)
> 
> diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
> index 44b705f..9ac77c1 100644
> --- a/PVE/VZDump/QemuServer.pm
> +++ b/PVE/VZDump/QemuServer.pm
> @@ -446,7 +446,6 @@ sub archive_pbs {
>       # proxmox-backup-client can only handle raw files and block devs
>       # only use it (directly) for disk-less VMs
>       if (!$diskcount) {
> -	my @pathlist;
>   	$self->loginfo("backup contains no disks");
>   
>   	local $ENV{PBS_PASSWORD} = $password;
> @@ -621,19 +620,8 @@ sub archive_vma {
>       }
>   
>       my $diskcount = scalar(@{$task->{disks}});
> -    if (PVE::QemuConfig->is_template($self->{vmlist}->{$vmid}) || !$diskcount) {
> -	my @pathlist;
> -	foreach my $di (@{$task->{disks}}) {
> -	    if ($di->{type} eq 'block' || $di->{type} eq 'file') {
> -		push @pathlist, "$di->{qmdevice}=$di->{path}";
> -	    } else {
> -		die "implement me";
> -	    }
> -	}
> -
> -	if (!$diskcount) {
> -	    $self->loginfo("backup contains no disks");
> -	}
> +    if (!$diskcount) {
> +	$self->loginfo("backup doesn't contain any disks");

nit: I'd leave the "backup contains no disks" message the same

>   
>   	my $outcmd;
>   	if ($comp) {
> @@ -646,9 +634,9 @@ sub archive_vma {
>   
>   	my $cmd = ['/usr/bin/vma', 'create', '-v', '-c', $conffile];
>   	push @$cmd, '-c', $firewall if -e $firewall;
> -	push @$cmd, $outcmd, @pathlist;
> +	push @$cmd, $outcmd;
>   
> -	$self->loginfo("starting template backup");
> +	$self->loginfo("starting backup");
>   	$self->loginfo(join(' ', @$cmd));
>   
>   	if ($opts->{stdout}) {
>