Commit 1fe412bb authored by Iustin Pop's avatar Iustin Pop
Browse files

htools: introduce new data type for node-evac



The evac-mode goes into the Types.hs module since it needs to be
available to Cluster.hs too.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 525bfb36
......@@ -35,6 +35,7 @@ module Ganeti.HTools.Loader
, lookupGroup
, commonSuffix
, RelocMode(..)
, EvacMode(..)
, RqType(..)
, Request(..)
, ClusterData(..)
......@@ -78,6 +79,7 @@ data RqType
-- secondary node
| Evacuate [Ndx] -- ^ Evacuate nodes
| MultiReloc [Idx] RelocMode -- ^ Multi-relocate mode
| NodeEvacuate [Idx] EvacMode -- ^ node-evacuate mode
deriving (Show, Read)
-- | A complete request, as received from Ganeti.
......
......@@ -59,6 +59,7 @@ module Ganeti.HTools.Types
, OpResult(..)
, connTimeout
, queryTimeout
, EvacMode(..)
) where
import qualified Data.Map as M
......@@ -279,3 +280,9 @@ class Element a where
name = nameOf e
-- | Updates the index of the element
setIdx :: a -> Int -> a
-- | The iallocator node-evacuate evac_mode type.
data EvacMode = ChangePrimary
| ChangeSecondary
| ChangeAll
deriving (Show, Read)
......@@ -76,6 +76,7 @@ processRequest request =
idx reqn exnodes
Evacuate exnodes -> Cluster.tryMGEvac gl nl il exnodes
MultiReloc _ _ -> fail "multi-reloc not handled"
NodeEvacuate _ _ -> fail "node-evacuate 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