From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id AB1421FF0AF for ; Fri, 20 Nov 2026 15:10:48 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E9364217E5; Fri, 20 Nov 2026 15:10:40 +0100 (CET) From: Jonas Theisen To: pve-devel@lists.proxmox.com Subject: [PATCH storage 2/2] rbd: do not let setting the EFI disk cache policy block VM start Date: Fri, 20 Nov 2026 15:10:07 +0100 Message-ID: <20261120141020.243160-3-j.theisen@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261120141020.243160-1-j.theisen@proxmox.com> References: <20261120141020.243160-1-j.theisen@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795183832489 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.082 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: REEMRZEVGHFZ3HLHCNNVMPHL7YU747OX X-Message-ID-Hash: REEMRZEVGHFZ3HLHCNNVMPHL7YU747OX X-MailFrom: j.theisen@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Setting the rbd_cache_policy image config while another client holds the exclusive lock, e.g. the source VM during a live migration, is forwarded to the lock owner. If the owner never reports completion, or its completion is lost in a race with a re-send of the request, the 'rbd config image set' command never returns and the VM start on the migration target hangs indefinitely. Abort the command after 60 seconds, which allows for one retry of the remote request, as librbd retries those every 30 seconds. The cache policy only affects the performance of EFI variable writes, so only warn if setting it fails, instead of failing the VM start and thus the migration. Signed-off-by: Jonas Theisen --- src/PVE/Storage/RBDPlugin.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/PVE/Storage/RBDPlugin.pm b/src/PVE/Storage/RBDPlugin.pm index 1b2caf8..a209f6f 100644 --- a/src/PVE/Storage/RBDPlugin.pm +++ b/src/PVE/Storage/RBDPlugin.pm @@ -419,7 +419,12 @@ sub rbd_volume_config_set { return if !$@ && defined($current) && $current eq $value; my $cmd = $rbd_cmd->($scfg, $storeid, 'config', 'image', 'set', $volname, $key, $value); - run_rbd_command($cmd, errmsg => "rbd config image set $volname $key $value error"); + # librbd retries a remote request every 30 seconds, so allow for one retry + run_rbd_command( + $cmd, + errmsg => "rbd config image set $volname $key $value error", + timeout => 60, + ); return; } @@ -633,7 +638,9 @@ sub qemu_blockdev_options { # SPI flash does lots of read-modify-write OPs, without writeback this gets really slow #3329 if ($options->{hints}->{'efi-disk'}) { - rbd_volume_config_set($scfg, $storeid, $name, 'rbd_cache_policy', 'writeback'); + # only affects performance, so do not fail the VM start, e.g. on the migration target + eval { rbd_volume_config_set($scfg, $storeid, $name, 'rbd_cache_policy', 'writeback') }; + warn "could not set rbd_cache_policy for EFI disk '$name' - $@" if $@; } return $blockdev; -- 2.47.3