N+1 redundancy was always a per-group property.
Do the same with shared-storage N+1 redundancy, i.e.,
restrict the escape candidates to nodes of the same
group.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 src/Ganeti/HTools/GlobalN1.hs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/Ganeti/HTools/GlobalN1.hs b/src/Ganeti/HTools/GlobalN1.hs
index ced324e..bc746e4 100644
--- a/src/Ganeti/HTools/GlobalN1.hs
+++ b/src/Ganeti/HTools/GlobalN1.hs
@@ -77,6 +77,10 @@ canEvacuateNode (nl, il) n = isOk $ do
   (nl', il') <- opToResult
                 . foldM move (nl, il) $ map (flip (,) Failover) drbdIdxs
   -- evacuate other instances
-  let escapenodes = filter (/= Node.idx n) $ Container.keys nl'
-  _ <- foldM (evac (Node.group n) escapenodes) (nl',il') sharedIdxs
+  let grp = Node.group n
+      escapenodes = filter (/= Node.idx n)
+                    . map Node.idx
+                    . filter ((== grp) . Node.group)
+                    $ Container.elems nl'
+  _ <- foldM (evac grp escapenodes) (nl',il') sharedIdxs
   return ()
-- 
2.2.0.rc0.207.ga3a616c

Reply via email to