@handle_orch_error
def apply_rgw(self, spec):
# type: (RGWSpec) -> str
- num_of_osds = self.get_ceph_option('osd_pool_default_size')
- assert type(num_of_osds) is int
- return self.rook_cluster.apply_objectstore(spec, num_of_osds)
+ num_replicas = self.get_ceph_option('osd_pool_default_size')
+ assert type(num_replicas) is int
+ leaf_type_id = self.get_ceph_option('osd_crush_chooseleaf_type')
+ assert type(leaf_type_id) is int
+ crush = self.get('osd_map_crush')
+ leaf_type = 'host'
+ for t in crush['types']:
+ if t['type_id'] == leaf_type_id:
+ leaf_type = t['name']
+ break
+ return self.rook_cluster.apply_objectstore(spec, num_replicas, leaf_type)
@handle_orch_error
def apply_nfs(self, spec):
self.coreV1_api.patch_node(host, matching_node)
return OrchResult(f'Removed {label} label from {host}')
- def apply_objectstore(self, spec: RGWSpec, num_replicas: int) -> str:
+ def apply_objectstore(self, spec: RGWSpec, num_replicas: int, leaf_type: str) -> str:
assert spec.service_id is not None
name = spec.service_id
)
),
dataPool=cos.DataPool(
+ failureDomain=leaf_type,
replicated=cos.Replicated(
size=num_replicas
)
),
metadataPool=cos.MetadataPool(
+ failureDomain=leaf_type,
replicated=cos.Replicated(
size=num_replicas
)