Safe Haskell | None |
---|
Some common types.
- type Idx = Int
- type Ndx = Int
- type Gdx = Int
- type NameAssoc = Map String Int
- type Score = Double
- type Weight = Double
- type GroupID = String
- defaultGroupID :: GroupID
- data MirrorType
- templateMirrorType :: DiskTemplate -> MirrorType
- data RSpec = RSpec {}
- data AllocInfo = AllocInfo {
- allocInfoVCpus :: Int
- allocInfoNCpus :: Double
- allocInfoMem :: Int
- allocInfoDisk :: Int
- type AllocStats = (AllocInfo, AllocInfo, AllocInfo)
- type NetworkID = String
- data ISpec = ISpec {
- iSpecMemorySize :: Int
- iSpecCpuCount :: Int
- iSpecDiskSize :: Int
- iSpecDiskCount :: Int
- iSpecNicCount :: Int
- iSpecSpindleUse :: Int
- loadISpec :: JSValue -> Result ISpec
- saveISpec :: ISpec -> JSValue
- toDictISpec :: ISpec -> [(String, JSValue)]
- defMinISpec :: ISpec
- defStdISpec :: ISpec
- defMaxISpec :: ISpec
- data MinMaxISpecs = MinMaxISpecs {}
- loadMinMaxISpecs :: JSValue -> Result MinMaxISpecs
- saveMinMaxISpecs :: MinMaxISpecs -> JSValue
- toDictMinMaxISpecs :: MinMaxISpecs -> [(String, JSValue)]
- defMinMaxISpecs :: [MinMaxISpecs]
- data IPolicy = IPolicy {
- iPolicyMinMaxISpecs :: [MinMaxISpecs]
- iPolicyStdSpec :: ISpec
- iPolicyDiskTemplates :: [DiskTemplate]
- iPolicyVcpuRatio :: Double
- iPolicySpindleRatio :: Double
- loadIPolicy :: JSValue -> Result IPolicy
- saveIPolicy :: IPolicy -> JSValue
- toDictIPolicy :: IPolicy -> [(String, JSValue)]
- rspecFromISpec :: ISpec -> RSpec
- defIPolicy :: IPolicy
- data DynUtil = DynUtil {}
- zeroUtil :: DynUtil
- baseUtil :: DynUtil
- addUtil :: DynUtil -> DynUtil -> DynUtil
- subUtil :: DynUtil -> DynUtil -> DynUtil
- type Placement = (Idx, Ndx, Ndx, IMove, Score)
- data IMove
- type MoveJob = ([Ndx], Idx, IMove, [String])
- unknownField :: String
- type JobSet = [MoveJob]
- defReservedDiskRatio :: Double
- unitMem :: Int
- unitDsk :: Int
- unitCpu :: Int
- data FailMode
- type FailStats = [(FailMode, Int)]
- type OpResult = GenericResult FailMode
- opToResult :: OpResult a -> Result a
- class Element a where
- data EvacMode
- evacModeFromRaw :: forall m. Monad m => String -> m EvacMode
- evacModeToRaw :: EvacMode -> String
- data AutoRepairType
- = ArFixStorage
- | ArMigrate
- | ArFailover
- | ArReinstall
- autoRepairTypeFromRaw :: forall m. Monad m => String -> m AutoRepairType
- autoRepairTypeToRaw :: AutoRepairType -> String
- data AutoRepairResult
- autoRepairResultFromRaw :: forall m. Monad m => String -> m AutoRepairResult
- autoRepairResultToRaw :: AutoRepairResult -> String
- data AutoRepairPolicy
- data AutoRepairSuspendTime
- data AutoRepairStatus
- data AutoRepairData = AutoRepairData {
- arType :: AutoRepairType
- arUuid :: String
- arTime :: ClockTime
- arJobs :: [JobId]
- arResult :: Maybe AutoRepairResult
- arTag :: String
Documentation
defaultGroupID :: GroupIDSource
Default group UUID (just a string, not a real UUID).
data MirrorType Source
Mirroring type.
MirrorNone | No mirroring/movability |
MirrorInternal | DRBD-type mirroring |
MirrorExternal | Shared-storage type mirroring |
Eq MirrorType | |
Show MirrorType |
templateMirrorType :: DiskTemplate -> MirrorTypeSource
Correspondence between disk template and mirror type.
The resource spec type.
Allocation stats type. This is used instead of RSpec
(which was
used at first), because we need to track more stats. The actual
data can refer either to allocated, or available, etc. values
depending on the context. See also
computeAllocationDelta
.
AllocInfo | |
|
type AllocStats = (AllocInfo, AllocInfo, AllocInfo)Source
Currently used, possibly to allocate, unallocable.
Instance specification type.
ISpec | |
|
toDictISpec :: ISpec -> [(String, JSValue)]Source
data MinMaxISpecs Source
Minimum and maximum instance specs type.
Eq MinMaxISpecs | |
Show MinMaxISpecs | |
Arbitrary MinMaxISpecs | |
JSON MinMaxISpecs |
loadMinMaxISpecs :: JSValue -> Result MinMaxISpecsSource
saveMinMaxISpecs :: MinMaxISpecs -> JSValueSource
toDictMinMaxISpecs :: MinMaxISpecs -> [(String, JSValue)]Source
Instance policy type.
IPolicy | |
|
loadIPolicy :: JSValue -> Result IPolicySource
saveIPolicy :: IPolicy -> JSValueSource
toDictIPolicy :: IPolicy -> [(String, JSValue)]Source
rspecFromISpec :: ISpec -> RSpecSource
Converts an ISpec type to a RSpec one.
The default instance policy.
The dynamic resource specs of a machine (i.e. load or load capacity, as opposed to size).
type Placement = (Idx, Ndx, Ndx, IMove, Score)Source
The description of an instance placement. It contains the instance index, the new primary and secondary node, the move being performed and the score of the cluster after the move.
An instance move definition.
Failover | Failover the instance (f) |
FailoverToAny Ndx | Failover to a random node (fa:np), for shared storage |
ReplacePrimary Ndx | Replace primary (f, r:np, f) |
ReplaceSecondary Ndx | Replace secondary (r:ns) |
ReplaceAndFailover Ndx | Replace secondary, failover (r:np, f) |
FailoverAndReplace Ndx | Failover, replace secondary (f, r:ns) |
Show IMove |
type MoveJob = ([Ndx], Idx, IMove, [String])Source
Formatted solution output for one move (involved nodes and commands.
unknownField :: StringSource
Unknown field in table output.
defReservedDiskRatio :: DoubleSource
Default max disk usage ratio.
Reason for an operation's falure.
FailMem | Failed due to not enough RAM |
FailDisk | Failed due to not enough disk |
FailCPU | Failed due to not enough CPU capacity |
FailN1 | Failed due to not passing N1 checks |
FailTags | Failed due to tag exclusion |
Bounded FailMode | |
Enum FailMode | |
Eq FailMode | |
Show FailMode | |
Arbitrary FailMode | |
FromString FailMode |
|
Arbitrary a => Arbitrary (OpResult a) |
type OpResult = GenericResult FailModeSource
Either-like data-type customized for our failure modes.
The failure values for this monad track the specific allocation
failures, so this is not a general error-monad (compare with the
Result
data type). One downside is that this type cannot encode a
generic failure mode, hence our way to build a FailMode from string
will instead raise an exception.
A generic class for items that have updateable names and indices.
Returns the name of the element
allNames :: a -> [String]Source
Returns all the known names of the element
Returns the index of the element
setAlias :: a -> String -> aSource
Updates the alias of the element
computeAlias :: String -> a -> aSource
Compute the alias by stripping a given suffix (domain) from the name
Updates the index of the element
The iallocator node-evacuate evac_mode type.
evacModeFromRaw :: forall m. Monad m => String -> m EvacModeSource
evacModeToRaw :: EvacMode -> StringSource
data AutoRepairType Source
The repair modes for the auto-repair tool.
Bounded AutoRepairType | |
Enum AutoRepairType | |
Eq AutoRepairType | |
Ord AutoRepairType | |
Show AutoRepairType |
autoRepairTypeFromRaw :: forall m. Monad m => String -> m AutoRepairTypeSource
autoRepairTypeToRaw :: AutoRepairType -> StringSource
data AutoRepairResult Source
The possible auto-repair results.
Bounded AutoRepairResult | |
Enum AutoRepairResult | |
Eq AutoRepairResult | |
Ord AutoRepairResult | |
Show AutoRepairResult |
autoRepairResultFromRaw :: forall m. Monad m => String -> m AutoRepairResultSource
autoRepairResultToRaw :: AutoRepairResult -> StringSource
data AutoRepairPolicy Source
The possible auto-repair policy for a given instance.
ArEnabled AutoRepairType | Auto-repair explicitly enabled |
ArSuspended AutoRepairSuspendTime | Suspended temporarily, or forever |
ArNotEnabled | Auto-repair not explicitly enabled |
Eq AutoRepairPolicy | |
Show AutoRepairPolicy |
data AutoRepairSuspendTime Source
The suspend timeout for ArSuspended
.
data AutoRepairStatus Source
The possible auto-repair states for any given instance.
ArHealthy (Maybe AutoRepairData) | No problems detected with the instance |
ArNeedsRepair AutoRepairData | Instance has problems, no action taken |
ArPendingRepair AutoRepairData | Repair jobs ongoing for the instance |
ArFailedRepair AutoRepairData | Some repair jobs for the instance failed |
Eq AutoRepairStatus | |
Show AutoRepairStatus |
data AutoRepairData Source
The data accompanying a repair operation (future, pending, or failed).
AutoRepairData | |
|
Eq AutoRepairData | |
Show AutoRepairData |