From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 AC874B5E8 for ; Wed, 9 Aug 2023 14:07:22 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8D96414B0C for ; Wed, 9 Aug 2023 14:06:52 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 9 Aug 2023 14:06:51 +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 9FE4D439A3 for ; Wed, 9 Aug 2023 14:06:51 +0200 (CEST) Message-ID: <3633fb7b-18bc-ff35-3c77-39ef22aeb372@proxmox.com> Date: Wed, 9 Aug 2023 14:06:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Content-Language: en-US To: Proxmox VE development discussion , Filip Schauer References: <20230809092200.34150-1-f.schauer@proxmox.com> From: Fiona Ebner In-Reply-To: <20230809092200.34150-1-f.schauer@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 2.015 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 NICE_REPLY_A -4.14 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] [PATCH v2 qemu-server] fix #3963: Skip TPM startup for template VMs 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: , X-List-Received-Date: Wed, 09 Aug 2023 12:07:22 -0000 Am 09.08.23 um 11:22 schrieb Filip Schauer: > Skip the software TPM startup when starting a template VM for performing > a backup. This fixes an error that occurs when the TPM state disk is > write-protected. > > Signed-off-by: Filip Schauer > --- > PVE/QemuServer.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index 484bc7f..c262c68 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -5923,7 +5923,7 @@ sub vm_start_nolock { > PVE::Systemd::enter_systemd_scope($vmid, "Proxmox VE VM $vmid", %systemd_properties); > > my $tpmpid; > - if (my $tpm = $conf->{tpmstate0}) { > + if ((my $tpm = $conf->{tpmstate0}) && !PVE::QemuConfig->is_template($conf)) { > # start the TPM emulator so QEMU can connect on start > $tpmpid = start_swtpm($storecfg, $vmid, $tpm, $migratedfrom); > } Well, this fixes the error that swtpm tries to write to the immutable image, but a quick test shows that it's still not possible to do a backup of the template (which is what the bug is about): > INFO: starting kvm to execute backup task > kvm: -chardev socket,id=tpmchar,path=/var/run/qemu-server/115.swtpm: Failed to connect to '/var/run/qemu-server/115.swtpm': No such file or directory > ERROR: Backup of VM 115 failed - start failed: QEMU exited with code The QEMU command line would need to be adapted accordingly too.