[Pkg-ganeti-devel] [ganeti] 134/165: Restrict evacuation to a group

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Tue Aug 11 13:53:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository ganeti.

commit f1218caa46aa576db849ead569d24dd4d87e9333
Author: Klaus Aehlig <aehlig at google.com>
Date:   Wed Jun 17 12:28:46 2015 +0200

    Restrict evacuation to a group
    
    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 <aehlig at google.com>
    Reviewed-by: Petr Pudlak <pudlak at google.com>
---
 src/Ganeti/HTools/GlobalN1.hs | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/Ganeti/HTools/GlobalN1.hs b/src/Ganeti/HTools/GlobalN1.hs
index ced324e..581d22d 100644
--- a/src/Ganeti/HTools/GlobalN1.hs
+++ b/src/Ganeti/HTools/GlobalN1.hs
@@ -36,7 +36,7 @@ module Ganeti.HTools.GlobalN1
   ( canEvacuateNode
   ) where
 
-import Control.Monad (foldM)
+import Control.Monad (foldM, foldM_)
 import Data.List (partition)
 
 import Ganeti.BasicTypes (isOk, Result)
@@ -77,6 +77,9 @@ 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
-  return ()
+  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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git



More information about the Pkg-ganeti-devel mailing list