Safe Haskell | None |
---|
Ganeti.HTools.Types
Description
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.
Constructors
MirrorNone | No mirroring/movability |
MirrorInternal | DRBD-type mirroring |
MirrorExternal | Shared-storage type mirroring |
Instances
Eq MirrorType # | |
Defined in Ganeti.HTools.Types | |
Show MirrorType # | |
Defined in Ganeti.HTools.Types Methods 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.
Constructors
RSpec | |
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
.
Constructors
AllocInfo | |
Fields
|
type AllocStats = (AllocInfo, AllocInfo, AllocInfo) Source #
Currently used, possibly to allocate, unallocable.
Instance specification type.
Constructors
ISpec | |
Fields
|
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.
Constructors
MinMaxISpecs | |
Fields |
Instances
Eq MinMaxISpecs # | |
Defined in Ganeti.HTools.Types | |
Show MinMaxISpecs # | |
Defined in Ganeti.HTools.Types Methods showsPrec :: Int -> MinMaxISpecs -> ShowS show :: MinMaxISpecs -> String showList :: [MinMaxISpecs] -> ShowS | |
JSON MinMaxISpecs # | |
Defined in Ganeti.HTools.Types Methods readJSON :: JSValue -> Result MinMaxISpecs showJSON :: MinMaxISpecs -> JSValue readJSONs :: JSValue -> Result [MinMaxISpecs] showJSONs :: [MinMaxISpecs] -> JSValue | |
ArrayObject MinMaxISpecs # | |
Defined in Ganeti.HTools.Types Methods toJSArray :: MinMaxISpecs -> [JSValue] Source # fromJSArray :: [JSValue] -> Result MinMaxISpecs Source # | |
DictObject MinMaxISpecs # | |
Defined in Ganeti.HTools.Types Methods toDict :: MinMaxISpecs -> [(String, JSValue)] Source # fromDictWKeys :: [(String, JSValue)] -> WriterT UsedKeys Result MinMaxISpecs Source # fromDict :: [(String, JSValue)] -> Result MinMaxISpecs Source # | |
Arbitrary MinMaxISpecs | |
Defined in Test.Ganeti.HTools.Types |
loadMinMaxISpecs :: JSValue -> Result MinMaxISpecs Source #
saveMinMaxISpecs :: MinMaxISpecs -> JSValue Source #
defMinMaxISpecs :: [MinMaxISpecs] Source #
Defult minimum and maximum instance specs.
Instance policy type.
Constructors
IPolicy | |
Fields
|
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).
Constructors
DynUtil | |
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.
Constructors
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.
Constructors
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.
Methods
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.
Constructors
ArFixStorage | |
ArMigrate | |
ArFailover | |
ArReinstall |
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.
Constructors
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 Methods (==) :: AutoRepairPolicy -> AutoRepairPolicy -> Bool (/=) :: AutoRepairPolicy -> AutoRepairPolicy -> Bool | |
Show AutoRepairPolicy # | |
Defined in Ganeti.HTools.Types Methods 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 Methods (==) :: AutoRepairSuspendTime -> AutoRepairSuspendTime -> Bool (/=) :: AutoRepairSuspendTime -> AutoRepairSuspendTime -> Bool | |
Show AutoRepairSuspendTime # | |
Defined in Ganeti.HTools.Types Methods showsPrec :: Int -> AutoRepairSuspendTime -> ShowS show :: AutoRepairSuspendTime -> String showList :: [AutoRepairSuspendTime] -> ShowS |
data AutoRepairStatus Source #
The possible auto-repair states for any given instance.
Constructors
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 Methods (==) :: AutoRepairStatus -> AutoRepairStatus -> Bool (/=) :: AutoRepairStatus -> AutoRepairStatus -> Bool | |
Show AutoRepairStatus # | |
Defined in Ganeti.HTools.Types Methods showsPrec :: Int -> AutoRepairStatus -> ShowS show :: AutoRepairStatus -> String showList :: [AutoRepairStatus] -> ShowS |
data AutoRepairData Source #
The data accompanying a repair operation (future, pending, or failed).
Constructors
AutoRepairData | |
Fields
|
Instances
Eq AutoRepairData # | |
Defined in Ganeti.HTools.Types Methods (==) :: AutoRepairData -> AutoRepairData -> Bool (/=) :: AutoRepairData -> AutoRepairData -> Bool | |
Show AutoRepairData # | |
Defined in Ganeti.HTools.Types Methods showsPrec :: Int -> AutoRepairData -> ShowS show :: AutoRepairData -> String showList :: [AutoRepairData] -> ShowS |