From 63f9ac2c7cd0db8f212bba6d278af2b0316b7760 Mon Sep 17 00:00:00 2001 From: James Page Date: Tue, 16 Oct 2018 09:33:05 +0100 Subject: [PATCH] Notify MON cluster of number of bootstrapped OSD's To allow the ceph-mon charm to better assess when the Ceph cluster is in a usable state, provide the number of OSD devices that where bootstrapped into the Ceph cluster over the relation to ceph-mon. This is used by the ceph-mon charm inconjunction with the 'expected-osd-count' configuration option to delay pool creation and issue of keys for clients until the expected number of OSD's have been bootstrapped into the cluster. Change-Id: I1370524f0f31120e3cb7305c5bc509a6494c5586 Closes-Bug: 1794878 --- hooks/ceph_hooks.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hooks/ceph_hooks.py b/hooks/ceph_hooks.py index 7494c3cd..a41586a4 100755 --- a/hooks/ceph_hooks.py +++ b/hooks/ceph_hooks.py @@ -499,6 +499,16 @@ def prepare_disks_and_activate(): ceph.tune_dev(dev) ceph.start_osds(get_devices()) + # Notify MON cluster as to how many OSD's this unit bootstrapped + # into the cluster + for r_id in relation_ids('mon'): + relation_set( + relation_id=r_id, + relation_settings={ + 'bootstrapped-osds': len(db.get('osd-devices', [])) + } + ) + def get_mon_hosts(): hosts = []