Revision 2cdaf225 htools/Ganeti/HTools/Cluster.hs

b/htools/Ganeti/HTools/Cluster.hs
931 931
    let no_nodes = Left "no nodes available"
932 932
        node_pairs = [(p,s) | p <- avail_nodes, s <- avail_nodes, p /= s]
933 933
    (nl', il', ops, _) <-
934
        annotateResult "Can't find any good nodes for relocation" $
934
        annotateResult "Can't find any good nodes for relocation" .
935 935
        eitherToResult $
936 936
        foldl'
937 937
        (\accu nodes -> case evacDrbdAllInner nl il inst gdx nodes of
......
974 974
             MirrorNone -> Bad "Can't relocate/evacuate non-mirrored instances"
975 975
             MirrorInternal -> Ok ReplaceSecondary
976 976
             MirrorExternal -> Ok FailoverToAny
977
  (nl', inst', _, ndx) <- annotateResult "Can't find any good node" $
977
  (nl', inst', _, ndx) <- annotateResult "Can't find any good node" .
978 978
                          eitherToResult $
979 979
                          foldl' (evacOneNodeInner nl inst gdx op_fn)
980 980
                          (Left "no nodes available") avail_nodes
......
1046 1046
    if Node.offline primary
1047 1047
      then do
1048 1048
        (nl', inst', _, _) <-
1049
          annotateResult "Failing over to the secondary" $
1049
          annotateResult "Failing over to the secondary" .
1050 1050
          opToResult $ applyMove nl inst Failover
1051 1051
        return (nl', inst', [Failover])
1052 1052
      else return (nl, inst, [])
......
1056 1056
  -- we now need to execute a replace secondary to the future
1057 1057
  -- primary node
1058 1058
  (nl2, inst2, _, _) <-
1059
    annotateResult "Changing secondary to new primary" $
1059
    annotateResult "Changing secondary to new primary" .
1060 1060
    opToResult $
1061 1061
    applyMove nl1 inst1 o1
1062 1062
  let ops2 = o1:ops1
1063 1063
  -- we now execute another failover, the primary stays fixed now
1064
  (nl3, inst3, _, _) <- annotateResult "Failing over to new primary" $
1064
  (nl3, inst3, _, _) <- annotateResult "Failing over to new primary" .
1065 1065
                        opToResult $ applyMove nl2 inst2 o2
1066 1066
  let ops3 = o2:ops2
1067 1067
  -- and finally another replace secondary, to the final secondary
1068 1068
  (nl4, inst4, _, _) <-
1069
    annotateResult "Changing secondary to final secondary" $
1069
    annotateResult "Changing secondary to final secondary" .
1070 1070
    opToResult $
1071 1071
    applyMove nl3 inst3 o3
1072 1072
  let ops4 = o3:ops3

Also available in: Unified diff