From 9626f028aac9075403417d62cc380c57cfaa25ad Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Tue, 10 May 2011 18:24:53 +0200
Subject: [PATCH] =?UTF-8?q?iallocator:=20Specify=20result=20of=20=E2=80=9C?=
 =?UTF-8?q?multi-relocate=E2=80=9D=20request?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 doc/design-multi-reloc.rst | 52 +++++++++++++++++++++++++++++++-------
 doc/iallocator.rst         |  8 +++---
 2 files changed, 47 insertions(+), 13 deletions(-)

diff --git a/doc/design-multi-reloc.rst b/doc/design-multi-reloc.rst
index fca80fa7b..f4b581c9e 100644
--- a/doc/design-multi-reloc.rst
+++ b/doc/design-multi-reloc.rst
@@ -56,19 +56,53 @@ The mode of operation will be one of:
 
 In all modes, the groups' ``alloc_policy`` attribute will be honored.
 
+.. _multi-reloc-result:
+
 Result
 ------
 
 In all storage models, an inter-group move can be modeled as a sequence
-of **replace secondary** and **failover** operations (when shared
-storage is used, they will all be failover operations within the
-corresponding mobility domain). This will be represented as a list of
-``(instance, [operations])`` pairs.
-
-For replace secondary operations, a new secondary node must be
-specified. For failover operations, a node *may* be specified when
-necessary, e.g. when shared storage is in use and there's no designated
-secondary for the instance.
+of **replace secondary**, **migration** and **failover** operations
+(when shared storage is used, they will all be failover or migration
+operations within the corresponding mobility domain).
+
+The result is expected to be a list of jobsets. Each jobset contains
+lists of serialized opcodes. Example::
+
+  [
+    [
+      { "OP_ID": "OP_INSTANCE_MIGRATE",
+        "instance_name": "inst1.example.com",
+      },
+      { "OP_ID": "OP_INSTANCE_MIGRATE",
+        "instance_name": "inst2.example.com",
+      },
+    ],
+    [
+      { "OP_ID": "OP_INSTANCE_REPLACE_DISKS",
+        "instance_name": "inst2.example.com",
+        "mode": "replace_new_secondary",
+        "remote_node": "node4.example.com"
+      },
+    ],
+    [
+      { "OP_ID": "OP_INSTANCE_FAILOVER",
+        "instance_name": "inst8.example.com",
+      },
+    ]
+  ]
+
+Accepted opcodes:
+
+- ``OP_INSTANCE_FAILOVER``
+- ``OP_INSTANCE_MIGRATE``
+- ``OP_INSTANCE_REPLACE_DISKS``
+
+Starting with the first set, Ganeti will submit all jobs of a set at the
+same time, enabling execution in parallel. Upon completion of all jobs
+in a set, the process is repeated for the next one. Ganeti is at liberty
+to abort the execution of the relocation after any jobset. In such a
+case the user is notified and can restart the relocation.
 
 .. vim: set textwidth=72 :
 .. Local Variables:
diff --git a/doc/iallocator.rst b/doc/iallocator.rst
index cef14ac25..3fe14877a 100644
--- a/doc/iallocator.rst
+++ b/doc/iallocator.rst
@@ -280,7 +280,7 @@ arguments:
     a string indicating the relocation mode; there are three possible
     values for this string: *keep_group*, *change_group*, and
     *any_group*, the semantics or which are explained in :ref:`the
-    design doc <multi-reloc-detailed-design>`
+    design document <multi-reloc-detailed-design>`
 
   target_groups
     this argument is only accepted when ``reloc_mode``, as explained
@@ -316,9 +316,9 @@ result
   entry in the input message, otherwise Ganeti will consider the result
   as failed
 
-  for multi-relocate mode, this is a list of 2-tuples in which the first
-  element of the tuple will be an instance name, and the second element
-  a list of operations to perform in order to relocate the instance
+  for multi-relocate mode, this is a list of lists of serialized
+  opcodes. See the :ref:`design document <multi-reloc-result>` for a
+  detailed dscription.
 
   for multi-evacuation mode, this is a list of lists; each element of
   the list is a list of instance name and the new secondary node
-- 
GitLab