This is a lot of duplication with modeMreloc, which will get sorted
out once we convert mreloc to change-group.
---
htools/Ganeti/HTools/IAlloc.hs | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/htools/Ganeti/HTools/IAlloc.hs b/htools/Ganeti/HTools/IAlloc.hs
index 8801949..6888a31 100644
--- a/htools/Ganeti/HTools/IAlloc.hs
+++ b/htools/Ganeti/HTools/IAlloc.hs
@@ -192,6 +192,19 @@ parseData body = do
| otherwise -> Bad $ "Invalid relocate mode " ++ s
Bad x -> Bad x
return $ MultiReloc rl_idx rl_mode
+ | optype == C.iallocatorModeNodeEvac ->
+ do
+ rl_names <- extrReq "instances"
+ rl_insts <- mapM (Container.findByName map_i) rl_names
+ let rl_idx = map Instance.idx rl_insts
+ rl_mode <-
+ case extrReq "evac_mode" of
+ Ok s | s == C.iallocatorNevacAll -> return ChangeAll
+ | s == C.iallocatorNevacPri -> return ChangePrimary
+ | s == C.iallocatorNevacSec -> return ChangeSecondary
+ | otherwise -> Bad $ "Invalid evacuate mode " ++ s
+ Bad x -> Bad x
+ return $ NodeEvacuate rl_idx rl_mode
| otherwise -> fail ("Invalid request type '" ++ optype ++ "'")
return $ Request rqtype cdata
--
1.7.5.4