Revision d02f941e htools/Ganeti/HTools/Types.hs

b/htools/Ganeti/HTools/Types.hs
74 74
  , EvacMode(..)
75 75
  , ISpec(..)
76 76
  , IPolicy(..)
77
  , defIPolicy
77 78
  ) where
78 79

  
79 80
import qualified Data.Map as M
......
152 153
  , THH.renameField "NicCount"   $ THH.simpleField "nic-count"   [t| Int |]
153 154
  ])
154 155

  
156
-- | The default minimum ispec.
157
defMinISpec :: ISpec
158
defMinISpec = ISpec { iSpecMemorySize = C.ipolicyDefaultsMinMemorySize
159
                    , iSpecCpuCount   = C.ipolicyDefaultsMinCpuCount
160
                    , iSpecDiskSize   = C.ipolicyDefaultsMinDiskSize
161
                    , iSpecDiskCount  = C.ipolicyDefaultsMinDiskCount
162
                    , iSpecNicCount   = C.ipolicyDefaultsMinNicCount
163
                    }
164

  
165
-- | The default standard ispec.
166
defStdISpec :: ISpec
167
defStdISpec = ISpec { iSpecMemorySize = C.ipolicyDefaultsStdMemorySize
168
                    , iSpecCpuCount   = C.ipolicyDefaultsStdCpuCount
169
                    , iSpecDiskSize   = C.ipolicyDefaultsStdDiskSize
170
                    , iSpecDiskCount  = C.ipolicyDefaultsStdDiskCount
171
                    , iSpecNicCount   = C.ipolicyDefaultsStdNicCount
172
                    }
173

  
174
-- | The default max ispec.
175
defMaxISpec :: ISpec
176
defMaxISpec = ISpec { iSpecMemorySize = C.ipolicyDefaultsMaxMemorySize
177
                    , iSpecCpuCount   = C.ipolicyDefaultsMaxCpuCount
178
                    , iSpecDiskSize   = C.ipolicyDefaultsMaxDiskSize
179
                    , iSpecDiskCount  = C.ipolicyDefaultsMaxDiskCount
180
                    , iSpecNicCount   = C.ipolicyDefaultsMaxNicCount
181
                    }
182

  
155 183
-- | Instance policy type.
156 184
$(THH.buildObject "IPolicy" "iPolicy"
157 185
  [ THH.renameField "StdSpec" $ THH.simpleField "std" [t| ISpec |]
......
159 187
  , THH.renameField "MaxSpec" $ THH.simpleField "max" [t| ISpec |]
160 188
  ])
161 189

  
190
-- | The default instance policy.
191
defIPolicy :: IPolicy
192
defIPolicy = IPolicy { iPolicyStdSpec = defStdISpec
193
                     , iPolicyMinSpec = defMinISpec
194
                     , iPolicyMaxSpec = defMaxISpec
195
                     }
196

  
162 197
-- | The dynamic resource specs of a machine (i.e. load or load
163 198
-- capacity, as opposed to size).
164 199
data DynUtil = DynUtil

Also available in: Unified diff