From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 4CDDB1FF0BC for ; Thu, 29 Oct 2026 06:31:51 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E3F13214DA; Thu, 29 Oct 2026 06:31:39 +0100 (CET) From: Kefu Chai To: pve-devel@lists.proxmox.com Subject: [PATCH manager v2 0/2] ceph: pool: create EC pools from an existing profile Date: Thu, 29 Oct 2026 13:31:24 +0800 Message-ID: <20261029053126.3490603-1-k.chai@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793251891421 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.259 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: YJZJEDV7UCRYIX4DPF2RJPLZLZHQQKDG X-Message-ID-Hash: YJZJEDV7UCRYIX4DPF2RJPLZLZHQQKDG X-MailFrom: k.chai@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: Hi, the docs suggest building an erasure code profile with the Ceph tools and passing it to 'pveceph pool create' as 'profile', but the schema still requires 'k' and 'm': # pveceph pool create test-ec --erasure-coding profile=default erasure-coding.m: property is missing and it is not optional erasure-coding.k: property is missing and it is not optional Patch 2 makes them optional with a profile, and refuses values that don't match it instead of ignoring them. Patch 1 has to go in first: destroypool removes the pool's profile by default, which would take 'default' with it. Now it only removes the profile createpool made for that pool, unless asked to. Thanks to Maximiliano for reviewing and testing v1 [1]. Changes in v2: patch 1: - reword the remove_ecprofile description as suggested - check the profile in one line with length(my $ecprofile = ...). The suggested form doesn't compile under strict, since && binds tighter than = and the "my" isn't visible yet in its own statement. - a second destroypool with remove_ecprofile=1 fails once the pool is gone, so the message for a kept profile now points to 'ceph osd erasure-code-profile rm ' instead - use v5.36 in the new test file patch 2: - describe 'k', 'm', 'failure-domain' and 'device-class' with "If 'profile' is set, it must match the ... of the profile" - rename $actual to $actual_profile, and the loop variables to $key, $value and $profile_value Both are rebased onto current master. I kept Maximiliano's Reviewed-by and Tested-by, since v2 only addresses his nits. I reran the tests and the reproducer from the review on a three node cluster: the kept profile can be removed with the command the message names, mismatching values are still refused before any pool is created, and pveceph's own profile is still removed by default. [1] https://lore.proxmox.com/pve-devel/20261021054425.3271742-1-k.chai@proxmox.com/ Kefu Chai (2): api: ceph: pool: destroypool: keep EC profiles pveceph did not create api: ceph: pool: createpool: make 'k' and 'm' optional with a profile PVE/API2/Ceph/Pool.pm | 77 +++++++++--- PVE/Ceph/Tools.pm | 25 ++-- test/CephPool_test.pl | 274 ++++++++++++++++++++++++++++++++++++++++++ test/Makefile | 6 +- 4 files changed, 356 insertions(+), 26 deletions(-) create mode 100755 test/CephPool_test.pl -- 2.47.3