Commit d02f941e authored by Iustin Pop's avatar Iustin Pop
Browse files

Add default ipolicy declarations


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 26fce8df
......@@ -74,6 +74,7 @@ module Ganeti.HTools.Types
, EvacMode(..)
, ISpec(..)
, IPolicy(..)
, defIPolicy
) where
import qualified Data.Map as M
......@@ -152,6 +153,33 @@ $(THH.buildObject "ISpec" "iSpec"
, THH.renameField "NicCount" $ THH.simpleField "nic-count" [t| Int |]
])
-- | The default minimum ispec.
defMinISpec :: ISpec
defMinISpec = ISpec { iSpecMemorySize = C.ipolicyDefaultsMinMemorySize
, iSpecCpuCount = C.ipolicyDefaultsMinCpuCount
, iSpecDiskSize = C.ipolicyDefaultsMinDiskSize
, iSpecDiskCount = C.ipolicyDefaultsMinDiskCount
, iSpecNicCount = C.ipolicyDefaultsMinNicCount
}
-- | The default standard ispec.
defStdISpec :: ISpec
defStdISpec = ISpec { iSpecMemorySize = C.ipolicyDefaultsStdMemorySize
, iSpecCpuCount = C.ipolicyDefaultsStdCpuCount
, iSpecDiskSize = C.ipolicyDefaultsStdDiskSize
, iSpecDiskCount = C.ipolicyDefaultsStdDiskCount
, iSpecNicCount = C.ipolicyDefaultsStdNicCount
}
-- | The default max ispec.
defMaxISpec :: ISpec
defMaxISpec = ISpec { iSpecMemorySize = C.ipolicyDefaultsMaxMemorySize
, iSpecCpuCount = C.ipolicyDefaultsMaxCpuCount
, iSpecDiskSize = C.ipolicyDefaultsMaxDiskSize
, iSpecDiskCount = C.ipolicyDefaultsMaxDiskCount
, iSpecNicCount = C.ipolicyDefaultsMaxNicCount
}
-- | Instance policy type.
$(THH.buildObject "IPolicy" "iPolicy"
[ THH.renameField "StdSpec" $ THH.simpleField "std" [t| ISpec |]
......@@ -159,6 +187,13 @@ $(THH.buildObject "IPolicy" "iPolicy"
, THH.renameField "MaxSpec" $ THH.simpleField "max" [t| ISpec |]
])
-- | The default instance policy.
defIPolicy :: IPolicy
defIPolicy = IPolicy { iPolicyStdSpec = defStdISpec
, iPolicyMinSpec = defMinISpec
, iPolicyMaxSpec = defMaxISpec
}
-- | The dynamic resource specs of a machine (i.e. load or load
-- capacity, as opposed to size).
data DynUtil = DynUtil
......
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