Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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 AllocPolicy
- allocPolicyFromRaw :: forall m. (Monad m, MonadFail m) => String -> m AllocPolicy
- allocPolicyToRaw :: AllocPolicy -> String
- type NetworkID = String
- data InstanceStatus
- instanceStatusFromRaw :: forall m. (Monad m, MonadFail m) => String -> m InstanceStatus
- instanceStatusToRaw :: InstanceStatus -> String
- data RSpec = RSpec {}
- data AllocInfo = AllocInfo {
- allocInfoVCpus :: Int
- allocInfoNCpus :: Double
- allocInfoMem :: Int
- allocInfoDisk :: Int
- allocInfoSpn :: Int
- type AllocStats = (AllocInfo, AllocInfo, AllocInfo)
- data DynUtil = DynUtil {}
- zeroUtil :: DynUtil
- baseUtil :: DynUtil
- addUtil :: DynUtil -> DynUtil -> DynUtil
- subUtil :: DynUtil -> DynUtil -> DynUtil
- defReservedDiskRatio :: Double
- unitMem :: Int
- unitCpu :: Int
- unitDsk :: Int
- unitSpindle :: Int
- unknownField :: String
- type Placement = (Idx, Ndx, Ndx, IMove, Score)
- data IMove
- data DiskTemplate
- = DTDiskless
- | DTFile
- | DTSharedFile
- | DTPlain
- | DTBlock
- | DTDrbd8
- | DTRbd
- | DTExt
- | DTGluster
- diskTemplateToRaw :: DiskTemplate -> String
- diskTemplateFromRaw :: forall m. (Monad m, MonadFail m) => String -> m DiskTemplate
- data MirrorType
- templateMirrorType :: DiskTemplate -> MirrorType
- type MoveJob = ([Ndx], Idx, IMove, [String])
- type JobSet = [MoveJob]
- class Element a where
- data FailMode
- type FailStats = [(FailMode, Int)]
- type OpResult = GenericResult FailMode
- opToResult :: OpResult a -> Result a
- data ISpec = ISpec {
- iSpecMemorySize :: Int
- iSpecCpuCount :: Int
- iSpecDiskSize :: Int
- iSpecDiskCount :: Int
- iSpecNicCount :: Int
- iSpecSpindleUse :: Int
- defMinISpec :: ISpec
- defStdISpec :: ISpec
- maxDisks :: Int
- maxNics :: Int
- defMaxISpec :: ISpec
- data MinMaxISpecs = MinMaxISpecs {}
- data IPolicy = IPolicy {
- iPolicyMinMaxISpecs :: [MinMaxISpecs]
- iPolicyStdSpec :: ISpec
- iPolicyDiskTemplates :: [DiskTemplate]
- iPolicyVcpuRatio :: Double
- iPolicySpindleRatio :: Double
- defIPolicy :: IPolicy
- rspecFromISpec :: ISpec -> RSpec
- data AutoRepairType
- autoRepairTypeToRaw :: AutoRepairType -> String
- autoRepairTypeFromRaw :: forall m. (Monad m, MonadFail m) => String -> m AutoRepairType
- data AutoRepairResult
- autoRepairResultToRaw :: AutoRepairResult -> String
- autoRepairResultFromRaw :: forall m. (Monad m, MonadFail m) => String -> m AutoRepairResult
- data AutoRepairPolicy
- data AutoRepairSuspendTime
- data AutoRepairData = AutoRepairData {
- arType :: AutoRepairType
- arUuid :: String
- arTime :: ClockTime
- arJobs :: [JobId]
- arResult :: Maybe AutoRepairResult
- arTag :: String
- data AutoRepairStatus
Documentation
Default group UUID (just a string, not a real UUID).
data AllocPolicy #
The Group allocation policy type.
Note that the order of constructors is important as the automatic Ord instance will order them in the order they are defined, so when changing this data type be careful about the interaction with the desired sorting order.
Constructors
AllocPreferred | |
AllocLastResort | |
AllocUnallocable |
Instances
allocPolicyFromRaw :: forall m. (Monad m, MonadFail m) => String -> m AllocPolicy #
allocPolicyToRaw :: AllocPolicy -> String #
data InstanceStatus #
The Instance real state type.
Constructors
StatusDown | |
StatusOffline | |
ErrorDown | |
ErrorUp | |
NodeDown | |
NodeOffline | |
Running | |
UserDown | |
WrongNode |
Instances
instanceStatusFromRaw :: forall m. (Monad m, MonadFail m) => String -> m InstanceStatus #
instanceStatusToRaw :: InstanceStatus -> String #
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) #
Currently used, possibly to allocate, unallocable.
The dynamic resource specs of a machine (i.e. load or load capacity, as opposed to size).
Constructors
DynUtil | |
defReservedDiskRatio :: Double #
Default max disk usage ratio.
unitSpindle :: Int #
Base spindles unit.
unknownField :: String #
Unknown field in table output.
type Placement = (Idx, Ndx, Ndx, IMove, Score) #
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) |
data DiskTemplate #
Instance disk template type. The disk template is a name for the
constructor of the disk configuration DiskLogicalId
used for
serialization, configuration values, etc.
Constructors
DTDiskless | |
DTFile | |
DTSharedFile | |
DTPlain | |
DTBlock | |
DTDrbd8 | |
DTRbd | |
DTExt | |
DTGluster |
Instances
diskTemplateToRaw :: DiskTemplate -> String #
diskTemplateFromRaw :: forall m. (Monad m, MonadFail m) => String -> m DiskTemplate #
data MirrorType #
Mirroring type.
Constructors
MirrorNone | No mirroring/movability |
MirrorInternal | DRBD-type mirroring |
MirrorExternal | Shared-storage type mirroring |
Instances
Show MirrorType # | |
Defined in Ganeti.HTools.Types Methods showsPrec :: Int -> MirrorType -> ShowS show :: MirrorType -> String showList :: [MirrorType] -> ShowS | |
Eq MirrorType # | |
Defined in Ganeti.HTools.Types |
templateMirrorType :: DiskTemplate -> MirrorType #
Correspondence between disk template and mirror type.
type MoveJob = ([Ndx], Idx, IMove, [String]) #
Formatted solution output for one move (involved nodes and commands.
A generic class for items that have updateable names and indices.
Methods
Returns the name of the element
Returns all the known names of the element
Returns the index of the element
setAlias :: a -> String -> a #
Updates the alias of the element
computeAlias :: String -> a -> a #
Compute the alias by stripping a given suffix (domain) from the name
Updates the index of the element
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 | |
Show FailMode # | |
Error FailMode # |
|
Defined in Ganeti.HTools.Types | |
Eq FailMode # | |
type OpResult = GenericResult FailMode #
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.
Instance specification type.
Constructors
ISpec | |
Fields
|
Instances
Show ISpec # | |
ArrayObject ISpec # | |
Defined in Ganeti.HTools.Types | |
DictObject ISpec # | |
Defined in Ganeti.HTools.Types | |
Eq ISpec # | |
JSON ISpec # | |
defMinISpec :: ISpec #
The default minimum ispec.
defStdISpec :: ISpec #
The default standard ispec.
defMaxISpec :: ISpec #
The default max ispec.
data MinMaxISpecs #
Minimum and maximum instance specs type.
Constructors
MinMaxISpecs | |
Fields |
Instances
Show MinMaxISpecs # | |
Defined in Ganeti.HTools.Types Methods showsPrec :: Int -> MinMaxISpecs -> ShowS show :: MinMaxISpecs -> String showList :: [MinMaxISpecs] -> ShowS | |
ArrayObject MinMaxISpecs # | |
Defined in Ganeti.HTools.Types | |
DictObject MinMaxISpecs # | |
Defined in Ganeti.HTools.Types Methods toDict :: MinMaxISpecs -> [(String, JSValue)] # fromDictWKeys :: [(String, JSValue)] -> WriterT UsedKeys Result MinMaxISpecs # fromDict :: [(String, JSValue)] -> Result MinMaxISpecs # | |
Eq MinMaxISpecs # | |
Defined in Ganeti.HTools.Types | |
JSON MinMaxISpecs # | |
Defined in Ganeti.HTools.Types Methods readJSON :: JSValue -> Result MinMaxISpecs showJSON :: MinMaxISpecs -> JSValue readJSONs :: JSValue -> Result [MinMaxISpecs] showJSONs :: [MinMaxISpecs] -> JSValue |
Instance policy type.
Constructors
IPolicy | |
Fields
|
Instances
Show IPolicy # | |
ArrayObject IPolicy # | |
Defined in Ganeti.HTools.Types | |
DictObject IPolicy # | |
Defined in Ganeti.HTools.Types | |
Eq IPolicy # | |
JSON IPolicy # | |
defIPolicy :: IPolicy #
The default instance policy.
rspecFromISpec :: ISpec -> RSpec #
Converts an ISpec type to a RSpec one.
data AutoRepairType #
The repair modes for the auto-repair tool.
Constructors
ArFixStorage | |
ArMigrate | |
ArFailover | |
ArReinstall |
Instances
autoRepairTypeToRaw :: AutoRepairType -> String #
autoRepairTypeFromRaw :: forall m. (Monad m, MonadFail m) => String -> m AutoRepairType #
data AutoRepairResult #
The possible auto-repair results.
Instances
autoRepairResultToRaw :: AutoRepairResult -> String #
autoRepairResultFromRaw :: forall m. (Monad m, MonadFail m) => String -> m AutoRepairResult #
data AutoRepairPolicy #
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
Show AutoRepairPolicy # | |
Defined in Ganeti.HTools.Types Methods showsPrec :: Int -> AutoRepairPolicy -> ShowS show :: AutoRepairPolicy -> String showList :: [AutoRepairPolicy] -> ShowS | |
Eq AutoRepairPolicy # | |
Defined in Ganeti.HTools.Types Methods (==) :: AutoRepairPolicy -> AutoRepairPolicy -> Bool (/=) :: AutoRepairPolicy -> AutoRepairPolicy -> Bool |
data AutoRepairSuspendTime #
The suspend timeout for ArSuspended
.
Instances
Show AutoRepairSuspendTime # | |
Defined in Ganeti.HTools.Types Methods showsPrec :: Int -> AutoRepairSuspendTime -> ShowS show :: AutoRepairSuspendTime -> String showList :: [AutoRepairSuspendTime] -> ShowS | |
Eq AutoRepairSuspendTime # | |
Defined in Ganeti.HTools.Types Methods (==) :: AutoRepairSuspendTime -> AutoRepairSuspendTime -> Bool (/=) :: AutoRepairSuspendTime -> AutoRepairSuspendTime -> Bool |
data AutoRepairData #
The data accompanying a repair operation (future, pending, or failed).
Constructors
AutoRepairData | |
Fields
|
Instances
Show AutoRepairData # | |
Defined in Ganeti.HTools.Types Methods showsPrec :: Int -> AutoRepairData -> ShowS show :: AutoRepairData -> String showList :: [AutoRepairData] -> ShowS | |
Eq AutoRepairData # | |
Defined in Ganeti.HTools.Types Methods (==) :: AutoRepairData -> AutoRepairData -> Bool (/=) :: AutoRepairData -> AutoRepairData -> Bool |
data AutoRepairStatus #
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
Show AutoRepairStatus # | |
Defined in Ganeti.HTools.Types Methods showsPrec :: Int -> AutoRepairStatus -> ShowS show :: AutoRepairStatus -> String showList :: [AutoRepairStatus] -> ShowS | |
Eq AutoRepairStatus # | |
Defined in Ganeti.HTools.Types Methods (==) :: AutoRepairStatus -> AutoRepairStatus -> Bool (/=) :: AutoRepairStatus -> AutoRepairStatus -> Bool |