]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add warning to other orchestrators
authorJoshua Schmid <jschmid@suse.de>
Wed, 8 Jan 2020 16:26:59 +0000 (17:26 +0100)
committerSage Weil <sage@redhat.com>
Tue, 28 Jan 2020 16:09:38 +0000 (10:09 -0600)
the extended drivegroup approach is not fully supported
with the other orchestrators and probably need to get reworked.

Signed-off-by: Joshua Schmid <jschmid@suse.de>
src/pybind/mgr/ansible/module.py
src/pybind/mgr/rook/module.py
src/pybind/mgr/test_orchestrator/module.py

index 1fd9732e15154e7a15760772e539e19e60caf3e3..aa2c1515b256ffd4fa1e2fe0dd4e29ae22a5e9c3 100644 (file)
@@ -353,28 +353,37 @@ class Module(MgrModule, orchestrator.Orchestrator):
         If no host provided the operation affects all the host in the OSDS role
 
 
-        :param drive_groups: (ceph.deployment.drive_group.DriveGroupSpec),
+        :param drive_groups: List[(ceph.deployment.drive_group.DriveGroupSpec)],
                             Drive group with the specification of drives to use
+
+        Caveat: Currently limited to a single DriveGroup.
+        The orchestrator_cli expects a single completion which
+        ideally represents a set of operations. This orchestrator
+        doesn't support this notion, yet. Hence it's only accepting
+        a single DriveGroup for now.
+            You can work around it by invoking:
+
+        $: ceph orchestrator osd create -i <dg.file>
+
+        multiple times. The drivegroup file must only contain one spec at a time.
         """
+        drive_group = drive_groups[0]
 
         # Transform drive group specification to Ansible playbook parameters
-        ops = []
-        for drive_group in drive_groups:
-            host, osd_spec = dg_2_ansible(drive_group)
-
-            # Create a new read completion object for execute the playbook
-            op = playbook_operation(client=self.ar_client,
-                                    playbook=ADD_OSD_PLAYBOOK,
-                                    result_pattern="",
-                                    params=osd_spec,
-                                    querystr_dict={"limit": host},
-                                    output_wizard=ProcessPlaybookResult(self.ar_client),
-                                    event_filter_list=["playbook_on_stats"])
-
-            self._launch_operation(op)
-            ops.append(op)
-
-        return ops
+        host, osd_spec = dg_2_ansible(drive_group)
+
+        # Create a new read completion object for execute the playbook
+        op = playbook_operation(client=self.ar_client,
+                                playbook=ADD_OSD_PLAYBOOK,
+                                result_pattern="",
+                                params=osd_spec,
+                                querystr_dict={"limit": host},
+                                output_wizard=ProcessPlaybookResult(self.ar_client),
+                                event_filter_list=["playbook_on_stats"])
+
+        self._launch_operation(op)
+
+        return op
 
     def remove_osds(self, osd_ids, destroy=False):
         """Remove osd's.
index f76f6cd5a86cb438c0f382b2accf981c7de7f732..098a66e81ba7f00bcf7c376b4120e36d825d5e52 100644 (file)
@@ -369,8 +369,22 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
             mgr=self
         )
 
-    def create_osds(self, drive_group):
+    def create_osds(self, drive_groups):
         # type: (List[DriveGroupSpec]) -> RookCompletion
+        """ Creates OSDs from a drive group specification.
+
+        Caveat: Currently limited to a single DriveGroup.
+        The orchestrator_cli expects a single completion which
+        ideally represents a set of operations. This orchestrator
+        doesn't support this notion, yet. Hence it's only accepting
+        a single DriveGroup for now.
+        You can work around it by invoking:
+
+        $: ceph orchestrator osd create -i <dg.file>
+
+        multiple times. The drivegroup file must only contain one spec at a time.
+        """
+        drive_group = drive_groups[0]
 
         targets = []  # type: List[str]
         if drive_group.data_devices:
index d1c29578573fc5fab83eb726fe540819f21ba729..642528aa5fc5c18e6eda99ce467318f94fb73abc 100644 (file)
@@ -13,6 +13,7 @@ except ImportError:
 import six
 
 from ceph.deployment import inventory
+from ceph.deployment.drive_group import DriveGroupSpec
 from mgr_module import CLICommand, HandleCommandResult
 from mgr_module import MgrModule
 
@@ -183,8 +184,23 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator):
 
         return result
 
-    def create_osds(self, drive_group):
-        # type: (orchestrator.DriveGroupSpec) -> TestCompletion
+    def create_osds(self, drive_groups):
+        # type: (List[DriveGroupSpec]) -> TestCompletion
+        """ Creates OSDs from a drive group specification.
+
+        Caveat: Currently limited to a single DriveGroup.
+        The orchestrator_cli expects a single completion which
+        ideally represents a set of operations. This orchestrator
+        doesn't support this notion, yet. Hence it's only accepting
+        a single DriveGroup for now.
+        You can work around it by invoking:
+
+        $: ceph orchestrator osd create -i <dg.file>
+
+        multiple times. The drivegroup file must only contain one spec at a time.
+        """
+        drive_group = drive_groups[0]
+
         def run(all_hosts):
             drive_group.validate(orchestrator.InventoryNode.get_host_names(all_hosts))
         return self.get_hosts().then(run).then(