From ab3de509b9700f63239974aaa4093e8e020fc793 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatt Date: Thu, 14 Aug 2025 13:47:15 +0530 Subject: [PATCH] feat: Auto Enable microceph orchestrator module Signed-off-by: Utkarsh Bhatt --- microceph/ceph/bootstrap.go | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/microceph/ceph/bootstrap.go b/microceph/ceph/bootstrap.go index c7d741df1..41e41c227 100644 --- a/microceph/ceph/bootstrap.go +++ b/microceph/ceph/bootstrap.go @@ -11,9 +11,9 @@ import ( "strings" "time" - "github.com/canonical/microceph/microceph/logger" "github.com/canonical/microceph/microceph/constants" "github.com/canonical/microceph/microceph/interfaces" + "github.com/canonical/microceph/microceph/logger" "github.com/pborman/uuid" @@ -133,6 +133,12 @@ func Bootstrap(ctx context.Context, s interfaces.StateInterface, data common.Boo return err } + // enable microceph orchestrator + err = setMicroCephOrchBackend() + if err != nil { + return err + } + // Re-generate the configuration from the database. err = UpdateConfig(ctx, s) if err != nil { @@ -399,5 +405,20 @@ func initMds(s interfaces.StateInterface, dataPath string) error { return fmt.Errorf("Failed to start metadata server: %w", err) } return nil +} +func setMicroCephOrchBackend() error { + args := []string{"mgr", "module", "enable", "microceph"} + _, err := cephRun(args...) + if err != nil { + return fmt.Errorf("failed to enable microceph mgr module: %w", err) + } + + args = []string{"orch", "set", "backend", "microceph"} + _, err = cephRun(args...) + if err != nil { + return fmt.Errorf("failed to set microceph orchestrator backend: %w", err) + } + + return nil }