, unitMem
, unitCpu
, unitDsk
+ , unitSpindle
, unknownField
, Placement
, IMove(..)
, FailStats
, OpResult
, opToResult
- , EvacMode(..)
, ISpec(..)
, MinMaxISpecs(..)
, IPolicy(..)
{ rspecCpu :: Int -- ^ Requested VCPUs
, rspecMem :: Int -- ^ Requested memory
, rspecDsk :: Int -- ^ Requested disk
+ , rspecSpn :: Int -- ^ Requested spindles
} deriving (Show, Eq)
-- | Allocation stats type. This is used instead of 'RSpec' (which was
, allocInfoNCpus :: Double -- ^ Normalised CPUs
, allocInfoMem :: Int -- ^ Memory
, allocInfoDisk :: Int -- ^ Disk
+ , allocInfoSpn :: Int -- ^ Spindles
} deriving (Show, Eq)
-- | Currently used, possibly to allocate, unallocable.
rspecFromISpec ispec = RSpec { rspecCpu = iSpecCpuCount ispec
, rspecMem = iSpecMemorySize ispec
, rspecDsk = iSpecDiskSize ispec
+ , rspecSpn = iSpecSpindleUse ispec
}
-- | The default instance policy.
unitCpu :: Int
unitCpu = 1
+-- | Base spindles unit.
+unitSpindle :: Int
+unitSpindle = 1
+
-- | Reason for an operation's falure.
data FailMode = FailMem -- ^ Failed due to not enough RAM
| FailDisk -- ^ Failed due to not enough disk
-- | Updates the index of the element
setIdx :: a -> Int -> a
--- | The iallocator node-evacuate evac_mode type.
-$(THH.declareSADT "EvacMode"
- [ ("ChangePrimary", 'C.iallocatorNevacPri)
- , ("ChangeSecondary", 'C.iallocatorNevacSec)
- , ("ChangeAll", 'C.iallocatorNevacAll)
- ])
-$(THH.makeJSONInstance ''EvacMode)
-
-- | The repair modes for the auto-repair tool.
$(THH.declareSADT "AutoRepairType"
-- Order is important here: from least destructive to most.