From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 00FAC1FF15C for ; Fri, 31 Oct 2025 11:37:31 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D91FDEC06; Fri, 31 Oct 2025 11:37:53 +0100 (CET) From: Friedrich Weber To: pve-devel@lists.proxmox.com Date: Fri, 31 Oct 2025 11:36:07 +0100 Message-ID: <20251031103709.60233-1-f.weber@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761907024237 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.012 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, plugin.pm, rbdplugin.pm, storage.pm, qemuserver.pm] Subject: [pve-devel] [PATCH qemu-server/storage 0/6] fix #5779: introduce guest hints to pass rxbounce flag to KRBD 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" When using Windows VMs with KRBD, it can be necessary to pass the rxbounce option to `rbd map` to avoid "bad crc/signature" warnings in the journal, retransmits and degraded performance. A first attempt to allow this [0] added an rxbounce storage option, but Thomas pointed out that this might nudge users towards creating two storages pointing to the same Ceph pool (one for Linux VMs that do not need rxbounce, one for Windows VMs that need rxbounce), which we should discourage. The cleanest solution from the user POV would be that PVE passes rxbounce only when mapping disks of VMs with Windows OS type, but this is not straightforward to implement, as pve-storage currently does not have knowledge about the "owner" of the volumes it activates. Fabian and Thomas suggested an approach to pass well-defined "hints" from e.g. qemu-server to pve-storage [0], one of which could be the guest's OS type, and based on which the RBD plugin could decide whether to pass rxbounce or not. We'd need to take care to avoid too much coupling between qemu-server and pve-storage, though. This patch series implements such hints. It builds upon an RFC [rfc] and some off-list discussion with Fiona (summary [1]). PVE::Storage::{activate,map}_volume now accept an additional optional parameter $hints that will be passed down to the storage plugin, where {activate,map}_volume also get an additional optional parameter $hints. This requires an plugin API bump but is backwards-compatible. Callers can use hints to pass well-defined information from upper layers to the storage layer. See patches for details. The Boolean 'guest-is-windows' hint denotes whether the to-be-activated volumes belong to a Windows guest. The RBD plugin uses that hint to decide whether to pass rxbounce when mapping a volume. The Boolean 'plugin-may-deactivate-volume' hint denotes whether the plugin may deactivate and re-activate the volume in order to apply the hint (this is necessary for rxbounce if the volume is already mapped), see patches for details. Currently, hints are only passed on VM start, as they are currently only relevant for rxbounce, and rxbounce is only relevant for VM start. This is to avoid having to update the many direct/indirect callsites of activate_volume. If needed in the future for other hints, we can still pass hints at more callsites. Since VM start is also used for backups, this means rxbounce is currently unnecessarily passed when mapping volumes for a backup of a stopped VM, but I think this is OK. Fiona and I discussed [1] that we could pass hints at some more callsites already now to save us some unmapping+mapping to apply rxbounce, e.g. for live restore. I took a look at it, but since generating hints requires the VM config which is currently assembled after volume activation, it looks like it would require some code restructuring, and I decided to postpone that in order to get a v1 out quicker. Can still take a look at it for the next version of the patch series if wanted. changes since rfc: - move hint definition, verify_hints and is_hint_supported to PVE::Storage::Plugin to make it less awkward to access for storage plugins -- not sure if this is needed? - add 'plugin-may-deactivate-volume' hint - only pass hints at VM start - RBD plugin: if the volume is already active, is not mapped with rxbounce but should be, and it is safe to deactivate: deactivate it to apply rxbounce. rfc: https://lore.proxmox.com/pve-devel/20251024122705.93761-1-f.weber@proxmox.com/ [0] https://lore.proxmox.com/pve-devel/20241025111304.99680-2-f.weber@proxmox.com/T/ [1] https://lore.proxmox.com/pve-devel/a6558cbe-7dea-4dbb-8c50-97753f2b0fda@proxmox.com/ storage: Friedrich Weber (5): plugin: introduce hints for activating and mapping volumes plugin api: bump api version and age storage: activate/map volumes: verify and pass hints to plugin plugin: rbd: factor out subroutine to obtain RBD ID plugin: rbd: pass rxbounce when mapping Windows VM guest volumes ApiChangeLog | 42 +++++++++++++++++++++++++++++ src/PVE/Storage.pm | 16 ++++++----- src/PVE/Storage/Plugin.pm | 43 +++++++++++++++++++++++++++-- src/PVE/Storage/RBDPlugin.pm | 52 +++++++++++++++++++++++++++++++----- 4 files changed, 139 insertions(+), 14 deletions(-) qemu-server: Friedrich Weber (1): fix #5779: vm start: pass storage hints when activating guest volumes src/PVE/QemuServer.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) Summary over all repositories: 5 files changed, 157 insertions(+), 15 deletions(-) -- Generated by git-murpp 0.8.1 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel