hail now expects correctly that relocate_from is of equal length with
the number of required nodes (fixme: there's a lot of not well
documented behaviour here… not nice for any other potential
IAllocators). As such, we _need_ to pass just the instance's primary
node.

Additionally, update the iallocator doc to correctly specify what this
list (`relocate_from`) contains.
---
 doc/iallocator.rst |    8 +++++---
 lib/cmdlib.py      |    4 +---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/iallocator.rst b/doc/iallocator.rst
index 723b948..92def06 100644
--- a/doc/iallocator.rst
+++ b/doc/iallocator.rst
@@ -285,9 +285,11 @@ Allocation needs, in addition:
 Relocation:
 
   relocate_from
-     a list of nodes to move the instance away from (note that with
-     Ganeti 2.0, this list will always contain a single node, the
-     current secondary of the instance); type *list of strings*
+     a list of nodes to move the instance away from; for DRBD-based
+     instances, this will contain a single node, the current secondary
+     of the instance, whereas for shared-storage instance, this will
+     contain also a single node, the current primary of the instance;
+     type *list of strings*
 
 As for ``node-evacuate``, it needs the following request arguments:
 
diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 2f06b3b..84a848b 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -8008,9 +8008,7 @@ class TLMigrateInstance(Tasklet):
     ial = IAllocator(self.cfg, self.rpc,
                      mode=constants.IALLOCATOR_MODE_RELOC,
                      name=self.instance_name,
-                     # TODO See why hail breaks with a single node below
-                     relocate_from=[self.instance.primary_node,
-                                    self.instance.primary_node],
+                     relocate_from=[self.instance.primary_node],
                      )
 
     ial.Run(self.lu.op.iallocator)
-- 
1.7.9.1

Reply via email to