Commit 2c3273e7 authored by Iustin Pop's avatar Iustin Pop
Browse files

hail: add new data types for the multi-reloc mode


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 9da4dc31
......@@ -34,6 +34,7 @@ module Ganeti.HTools.Loader
, lookupInstance
, lookupGroup
, commonSuffix
, RelocMode(..)
, RqType(..)
, Request(..)
, ClusterData(..)
......@@ -59,6 +60,12 @@ exTagsPrefix = "htools:iextags:"
-- * Types
-- | The iallocator multi-evac group mode type.
data RelocMode = KeepGroup
| ChangeGroup [Gdx]
| AnyGroup
deriving (Show, Read)
{-| The iallocator request type.
This type denotes what request we got from Ganeti and also holds
......@@ -70,6 +77,7 @@ data RqType
| Relocate Idx Int [Ndx] -- ^ Move an instance to a new
-- secondary node
| Evacuate [Ndx] -- ^ Evacuate nodes
| MultiReloc [Idx] RelocMode -- ^ Multi-relocate mode
deriving (Show, Read)
-- | A complete request, as received from Ganeti.
......
......@@ -74,6 +74,7 @@ processRequest request =
Relocate idx reqn exnodes -> Cluster.tryMGReloc gl nl il
idx reqn exnodes
Evacuate exnodes -> Cluster.tryMGEvac gl nl il exnodes
MultiReloc _ _ -> fail "multi-reloc not handled"
-- | Reads the request from the data file(s)
readRequest :: Options -> [String] -> IO Request
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment