]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/rook: use default replication size in orch apply rgw
authorJoseph Sawaya <jsawaya@redhat.com>
Tue, 7 Sep 2021 13:06:08 +0000 (09:06 -0400)
committerJoseph Sawaya <jsawaya@redhat.com>
Mon, 27 Sep 2021 18:51:13 +0000 (14:51 -0400)
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 <jsawaya@redhat.com>
qa/suites/orch/rook/smoke/3-final.yaml
src/pybind/mgr/rook/module.py
src/pybind/mgr/rook/rook_cluster.py

index 7628cc9da2126fbfa3b5e43c3eeb3cb2dadf6da3..90bbafad6e0f292e87790de4fa16b0f4fa0dae4d 100644 (file)
@@ -6,3 +6,4 @@ tasks:
       - ceph orch ls
       - ceph orch host ls
       - ceph orch device ls
+      - ceph orch apply rgw foo
index 6303355877c7f98bfcb68d2b883769f10621b208..26042e8317ab616bfcb9167fd5c9a488b00c3be0 100644 (file)
@@ -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):
index 5c701bd0a872408f60f70540f2dbb80c179d6110..df7f7fabbfbb94a31579d47ebbac587f6e3a9db1 100644 (file)
@@ -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: