From 4055b109151599f5fed175f9c07165f23a29e07e Mon Sep 17 00:00:00 2001
From: Adeodato Simo <dato@google.com>
Date: Fri, 25 Mar 2011 20:57:44 +0000
Subject: [PATCH] Add design for inter-group instance moves (multi-reloc)

Signed-off-by: Adeodato Simo <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 Makefile.am                |  1 +
 doc/design-draft.rst       |  1 +
 doc/design-multi-reloc.rst | 75 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 77 insertions(+)
 create mode 100644 doc/design-multi-reloc.rst

diff --git a/Makefile.am b/Makefile.am
index dd9035a8f..a90da284c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -282,6 +282,7 @@ docrst = \
 	doc/design-http-server.rst \
 	doc/design-impexp2.rst \
 	doc/design-lu-generated-jobs.rst \
+	doc/design-multi-reloc.rst \
 	doc/cluster-merge.rst \
 	doc/design-shared-storage.rst \
 	doc/devnotes.rst \
diff --git a/doc/design-draft.rst b/doc/design-draft.rst
index 587837cc0..2f736ca5b 100644
--- a/doc/design-draft.rst
+++ b/doc/design-draft.rst
@@ -9,6 +9,7 @@ Design document drafts
    design-http-server.rst
    design-impexp2.rst
    design-lu-generated-jobs.rst
+   design-multi-reloc.rst
 
 .. vim: set textwidth=72 :
 .. Local Variables:
diff --git a/doc/design-multi-reloc.rst b/doc/design-multi-reloc.rst
new file mode 100644
index 000000000..da029cb25
--- /dev/null
+++ b/doc/design-multi-reloc.rst
@@ -0,0 +1,75 @@
+====================================
+Moving instances accross node groups
+====================================
+
+This design document explains the changes needed in Ganeti to perform
+instance moves across node groups. Reader familiarity with the following
+existing documents is advised:
+
+- :doc:`Current IAllocator specification <iallocator>`
+- :doc:`Shared storage model in 2.3+ <design-shared-storage>`
+
+Motivation and and design proposal
+==================================
+
+At the moment, moving instances away from their primary or secondary
+nodes with the ``relocate`` and ``multi-evacuate`` IAllocator calls
+restricts target nodes to those on the same node group. This ensures a
+mobility domain is never crossed, and allows normal operation of each
+node group to be confined within itself.
+
+It is desirable, however, to have a way of moving instances across node
+groups so that, for example, it is possible to move a set of instances
+to another group for policy reasons, or completely empty a given group
+to perform maintenance operations.
+
+To implement this, we propose a new ``multi-relocate`` IAllocator call
+that will be able to compute inter-group instance moves, taking into
+account mobility domains as appropriate. The interface proposed below
+should be enough to cover the use cases mentioned above.
+
+Detailed design
+===============
+
+We introduce a new ``multi-relocate`` IAllocator call whose input will
+be a list of instances to move, and a "mode of operation" that will
+determine what groups will be candidates to receive the new instances.
+
+The mode of operation will be one of:
+
+- *Stay in group*: the instances will be moved off their current nodes,
+  but will stay in the same group; this is what the ``relocate`` call
+  does, but here it can act on multiple instances. (Typically, the
+  source nodes will be marked as drained, to avoid just exchanging
+  instances among them.)
+
+- *Change group*: this mode accepts one extra parameter, a list of node
+  group UUIDs; the instances will be moved away from their current
+  group, to any of the groups in this list. If the list is empty, the
+  request is, simply, "change group": the instances are placed in any
+  group but their original one.
+
+- *Any*: for each instance, any group is valid, including its current
+  one.
+
+In all modes, the groups' ``alloc_policy`` attribute will be honored.
+
+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.
+
+.. vim: set textwidth=72 :
+.. Local Variables:
+.. mode: rst
+.. fill-column: 72
+.. End:
-- 
GitLab