Safe Haskell | None |
---|
Some common types.
Synopsis
- 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
- allocInfoSpn :: 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
- defMinISpec :: ISpec
- defStdISpec :: ISpec
- maxDisks :: Int
- maxNics :: Int
- defMaxISpec :: ISpec
- data MinMaxISpecs = MinMaxISpecs {}
- loadMinMaxISpecs :: JSValue -> Result MinMaxISpecs
- saveMinMaxISpecs :: MinMaxISpecs -> JSValue
- defMinMaxISpecs :: [MinMaxISpecs]
- data IPolicy = IPolicy {
- iPolicyMinMaxISpecs :: [MinMaxISpecs]
- iPolicyStdSpec :: ISpec
- iPolicyDiskTemplates :: [DiskTemplate]
- iPolicyVcpuRatio :: Double
- iPolicySpindleRatio :: Double
- loadIPolicy :: JSValue -> Result IPolicy
- saveIPolicy :: IPolicy -> 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
- unitSpindle :: Int
- data FailMode
- type FailStats = [(FailMode, Int)]
- type OpResult = GenericResult FailMode
- opToResult :: OpResult a -> Result a
- class Element a where
- data AutoRepairType
- autoRepairTypeFromRaw :: forall m. (Monad m, MonadFail m) => String -> m AutoRepairType
- autoRepairTypeToRaw :: AutoRepairType -> String
- data AutoRepairResult
- autoRepairResultFromRaw :: forall m. (Monad m, MonadFail 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 :: GroupID Source #
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 |
Instances
Eq MirrorType # | |
Defined in Ganeti.HTools.Types (==) :: MirrorType -> MirrorType -> Bool (/=) :: MirrorType -> MirrorType -> Bool | |
Show MirrorType # | |
Defined in Ganeti.HTools.Types showsPrec :: Int -> MirrorType -> ShowS show :: MirrorType -> String showList :: [MirrorType] -> ShowS |
templateMirrorType :: DiskTemplate -> MirrorType Source #
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 | |
|
Instances
Eq ISpec # | |
Show ISpec # | |
JSON ISpec # | |
ArrayObject ISpec # | |
Defined in Ganeti.HTools.Types | |
DictObject ISpec # | |
Arbitrary ISpec | |
defMinISpec :: ISpec Source #
The default minimum ispec.
defStdISpec :: ISpec Source #
The default standard ispec.
defMaxISpec :: ISpec Source #
The default max ispec.
data MinMaxISpecs Source #
Minimum and maximum instance specs type.
Instances
loadMinMaxISpecs :: JSValue -> Result MinMaxISpecs Source #
saveMinMaxISpecs :: MinMaxISpecs -> JSValue Source #
defMinMaxISpecs :: [MinMaxISpecs] Source #
Defult minimum and maximum instance specs.
Instance policy type.
IPolicy | |
|
Instances
Eq IPolicy # | |
Show IPolicy # | |
JSON IPolicy # | |
ArrayObject IPolicy # | |
Defined in Ganeti.HTools.Types | |
DictObject IPolicy # | |
Arbitrary IPolicy | |
loadIPolicy :: JSValue -> Result IPolicy Source #
saveIPolicy :: IPolicy -> JSValue Source #
rspecFromISpec :: ISpec -> RSpec Source #
Converts an ISpec type to a RSpec one.
defIPolicy :: IPolicy Source #
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) |
type MoveJob = ([Ndx], Idx, IMove, [String]) Source #
Formatted solution output for one move (involved nodes and commands.
unknownField :: String Source #
Unknown field in table output.
defReservedDiskRatio :: Double Source #
Default max disk usage ratio.
unitSpindle :: Int Source #
Base spindles unit.
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 |
FailMig | Failed due to migration restrictions |
FailDiskCount | Failed due to wrong number of disks |
FailSpindles | Failed due to wrong/missing spindles |
FailInternal | Internal error |
Instances
Bounded FailMode # | |
Defined in Ganeti.HTools.Types | |
Enum FailMode # | |
Defined in Ganeti.HTools.Types | |
Eq FailMode # | |
Show FailMode # | |
Error FailMode # |
|
Defined in Ganeti.HTools.Types | |
Arbitrary FailMode | |
Arbitrary a => Arbitrary (OpResult a) | |
type OpResult = GenericResult FailMode Source #
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.
class Element a where Source #
A generic class for items that have updateable names and indices.
nameOf :: a -> String Source #
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 -> a Source #
Updates the alias of the element
computeAlias :: String -> a -> a Source #
Compute the alias by stripping a given suffix (domain) from the name
setIdx :: a -> Int -> a Source #
Updates the index of the element
data AutoRepairType Source #
The repair modes for the auto-repair tool.
Instances
autoRepairTypeFromRaw :: forall m. (Monad m, MonadFail m) => String -> m AutoRepairType Source #
autoRepairTypeToRaw :: AutoRepairType -> String Source #
data AutoRepairResult Source #
The possible auto-repair results.
Instances
autoRepairResultFromRaw :: forall m. (Monad m, MonadFail m) => String -> m AutoRepairResult Source #
autoRepairResultToRaw :: AutoRepairResult -> String Source #
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 |
Instances
Eq AutoRepairPolicy # | |
Defined in Ganeti.HTools.Types (==) :: AutoRepairPolicy -> AutoRepairPolicy -> Bool (/=) :: AutoRepairPolicy -> AutoRepairPolicy -> Bool | |
Show AutoRepairPolicy # | |
Defined in Ganeti.HTools.Types showsPrec :: Int -> AutoRepairPolicy -> ShowS show :: AutoRepairPolicy -> String showList :: [AutoRepairPolicy] -> ShowS |
data AutoRepairSuspendTime Source #
The suspend timeout for ArSuspended
.
Instances
Eq AutoRepairSuspendTime # | |
Defined in Ganeti.HTools.Types (==) :: AutoRepairSuspendTime -> AutoRepairSuspendTime -> Bool (/=) :: AutoRepairSuspendTime -> AutoRepairSuspendTime -> Bool | |
Show AutoRepairSuspendTime # | |
Defined in Ganeti.HTools.Types showsPrec :: Int -> AutoRepairSuspendTime -> ShowS show :: AutoRepairSuspendTime -> String showList :: [AutoRepairSuspendTime] -> ShowS |
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 |
Instances
Eq AutoRepairStatus # | |
Defined in Ganeti.HTools.Types (==) :: AutoRepairStatus -> AutoRepairStatus -> Bool (/=) :: AutoRepairStatus -> AutoRepairStatus -> Bool | |
Show AutoRepairStatus # | |
Defined in Ganeti.HTools.Types showsPrec :: Int -> AutoRepairStatus -> ShowS show :: AutoRepairStatus -> String showList :: [AutoRepairStatus] -> ShowS |
data AutoRepairData Source #
The data accompanying a repair operation (future, pending, or failed).
AutoRepairData | |
|
Instances
Eq AutoRepairData # | |
Defined in Ganeti.HTools.Types (==) :: AutoRepairData -> AutoRepairData -> Bool (/=) :: AutoRepairData -> AutoRepairData -> Bool | |
Show AutoRepairData # | |
Defined in Ganeti.HTools.Types showsPrec :: Int -> AutoRepairData -> ShowS show :: AutoRepairData -> String showList :: [AutoRepairData] -> ShowS |