public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH manager] fix #8163: ceph: pool create: pass the CRUSH rule on creation
@ 2026-10-15  7:19 Kefu Chai
  2026-10-15 22:55 ` applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Kefu Chai @ 2026-10-15  7:19 UTC (permalink / raw)
  To: pve-devel

create_pool() only passes the pool name and pg_num to "osd pool create"
and sets the CRUSH rule afterwards with "osd pool set". Ceph checks
mon_max_pg_per_osd when a pool is created, against the rule it is
created with, but not when the rule of an existing pool changes. So a
pool with a non-default rule is checked against the OSDs and pools of
the default rule. It is refused if those are near the limit, even if it
would fit on its own rule, and it is never checked against its own
rule.

Pass the rule to "osd pool create" for replicated pools. Erasure-coded
pools stay as they are, since Ceph creates their rule from the profile.

Keep setting the size afterwards. Ceph checks the limit again when the
size grows, and with this change that check uses the pool's own rule.
Passing the size on creation would also make it fail in stretch mode,
unless the size matches mon_stretch_pool_size.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
 PVE/Ceph/Tools.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/Ceph/Tools.pm b/PVE/Ceph/Tools.pm
index 1eed2a2d..94177709 100644
--- a/PVE/Ceph/Tools.pm
+++ b/PVE/Ceph/Tools.pm
@@ -349,6 +349,10 @@ sub create_pool {
     $mon_params->{erasure_code_profile} = extract_param($param, 'erasure_code_profile')
         if $param->{erasure_code_profile};
 
+    # Ceph checks mon_max_pg_per_osd against the rule given on create, not on a later rule change
+    $mon_params->{rule} = extract_param($param, 'crush_rule')
+        if $param->{crush_rule} && ($mon_params->{pool_type} // '') ne 'erasure';
+
     $rados->mon_command($mon_params);
 
     set_pool($pool, $param);
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-15 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15  7:19 [PATCH manager] fix #8163: ceph: pool create: pass the CRUSH rule on creation Kefu Chai
2026-10-15 22:55 ` applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal