Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
gravel: apply default ruleset to existing pools
Browse files Browse the repository at this point in the history
The KV store creates a pool during cluster bringup, which (because
threads) inevitably happens before the default ruleset is set in
the cluster config, so we need ensure we apply that ruleset to any
existing pools as well.

Signed-off-by: Tim Serong <tserong@suse.com>
  • Loading branch information
tserong committed Sep 14, 2021
1 parent 5fe5a3b commit e652542
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gravel/controllers/orch/ceph.py
Expand Up @@ -328,6 +328,15 @@ def set_default_ruleset(self) -> bool:
if not self._set_default_ruleset_config(rulesetid):
return False

# The KV store creates a pool during cluster bringup, which (because
# threads) inevitably happens before the default ruleset is set in
# the cluster config above, so we need ensure we apply that ruleset
# to any existing pools as well.
pools: List[CephOSDPoolEntryModel] = self.get_pools()
for pool in pools:
if not self.set_pool_ruleset(pool.pool_name, "single_node_rule"):
return False

return True

def set_replicated_ruleset(self) -> bool:
Expand Down

0 comments on commit e652542

Please sign in to comment.