def get_osd_num(self, context, group_id): osds = db.osd_get_all(context) osd_num = 0 for osd in osds: if osd['deleted'] == False and \ str(osd['storage_group_id']) == str(group_id): osd_num = osd_num + 1 return osd_num
def get_storage_group_list(self, context): LOG.info('get_storage_group_list in conductor manager') storage_group_list = db.storage_group_get_all(context) storage_group_list = [x for x in storage_group_list if x.status == "IN"] osds = db.osd_get_all(context) group_list = {} if storage_group_list: for group in storage_group_list: osd_num=0 for osd in osds: if osd['storage_group_id'] == group['id']: osd_num = osd_num + 1 if osd_num > 0: group_list[group['id']] = group['name'] return group_list