diff --git a/htools/Ganeti/HTools/IAlloc.hs b/htools/Ganeti/HTools/IAlloc.hs index 8801949f552f88e22e4c277d7a0327f31bcad590..6888a3108ca93860c411c45aa3992449d2c18f94 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