From: Joseph Sawaya Date: Tue, 7 Sep 2021 13:06:08 +0000 (-0400) Subject: mgr/rook: use default replication size in orch apply rgw X-Git-Tag: v17.1.0~781^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f4980c39dbd1ede4e42c1a02d5e12169501d960d;p=ceph.git mgr/rook: use default replication size in orch apply rgw This commit changes `orch apply rgw` to use the osd_pool_default_size when setting the replication size for the data pool and metadata pool of the rgw daemon. This commit also adds `orch apply rgw` to the Rook QA. Signed-off-by: Joseph Sawaya --- diff --git a/qa/suites/orch/rook/smoke/3-final.yaml b/qa/suites/orch/rook/smoke/3-final.yaml index 7628cc9da212..90bbafad6e0f 100644 --- a/qa/suites/orch/rook/smoke/3-final.yaml +++ b/qa/suites/orch/rook/smoke/3-final.yaml @@ -6,3 +6,4 @@ tasks: - ceph orch ls - ceph orch host ls - ceph orch device ls + - ceph orch apply rgw foo diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index 6303355877c7..26042e8317ab 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -450,7 +450,9 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): @handle_orch_error def apply_rgw(self, spec): # type: (RGWSpec) -> str - return self.rook_cluster.apply_objectstore(spec) + 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) @handle_orch_error def apply_nfs(self, spec): diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index 5c701bd0a872..df7f7fabbfbb 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -894,7 +894,7 @@ class RookCluster(object): self.coreV1_api.patch_node(host, matching_node) return OrchResult(f'Removed {label} label from {host}') - def apply_objectstore(self, spec: RGWSpec) -> str: + def apply_objectstore(self, spec: RGWSpec, num_replicas: int) -> str: assert spec.service_id is not None name = spec.service_id @@ -926,16 +926,28 @@ class RookCluster(object): port=port, securePort=secure_port, instances=spec.placement.count or 1, - placement=ccl.NodeAffinity( - requiredDuringSchedulingIgnoredDuringExecution=ccl.RequiredDuringSchedulingIgnoredDuringExecution( - nodeSelectorTerms=ccl.NodeSelectorTermsList( - [ - placement_spec_to_node_selector(spec.placement, all_hosts) - ] + placement=cos.Placement( + cos.NodeAffinity( + requiredDuringSchedulingIgnoredDuringExecution=cos.RequiredDuringSchedulingIgnoredDuringExecution( + nodeSelectorTerms=cos.NodeSelectorTermsList( + [ + placement_spec_to_node_selector(spec.placement, all_hosts) + ] + ) ) ) ) ), + dataPool=cos.DataPool( + replicated=cos.Replicated( + size=num_replicas + ) + ), + metadataPool=cos.MetadataPool( + replicated=cos.Replicated( + size=num_replicas + ) + ) ) ) if spec.rgw_zone: