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
This commit is contained in:
James Page 2018-10-16 09:33:05 +01:00
parent ce97b7a479
commit 63f9ac2c7c

View File

@ -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 = []