ganeti

Safe HaskellNone

Ganeti.Objects.Disk

Description

Implementation of the Ganeti Disk config object.

Synopsis

Documentation

devType :: StringSource

Constant for the dev_type key entry in the disk config.

type DiskParams = Container JSValueSource

The disk parameters type.

type DRBDSecret = StringSource

An alias for DRBD secrets

data LogicalVolume Source

Constructors

LogicalVolume 

Fields

lvGroup :: String
 
lvVolume :: String
 

Instances

Eq LogicalVolume 
Ord LogicalVolume 
Show LogicalVolume 
JSON LogicalVolume 
Validatable LogicalVolume

Check the constraints for a VGLV names (except the \@\dev/@ check).

Arbitrary LogicalVolume 

data DiskLogicalId Source

The disk configuration type. This includes the disk type itself, for a more complete consistency. Note that since in the Python code-base there's no authoritative place where we document the logical id, this is probably a good reference point. There is a bijective correspondence between the DiskLogicalId constructors and DiskTemplate.

Constructors

LIDPlain LogicalVolume

Volume group, logical volume

LIDDrbd8 String String Int Int Int (Private DRBDSecret)

NodeA, NodeB, Port, MinorA, MinorB, Secret

LIDFile FileDriver String

Driver, path

LIDSharedFile FileDriver String

Driver, path

LIDGluster FileDriver String

Driver, path

LIDBlockDev BlockDriver String

Driver, path (must be under /dev)

LIDRados String String

Unused, path

LIDExt String String

ExtProvider, unique name

Instances

lidDiskType :: DiskLogicalId -> DiskTemplateSource

Mapping from a logical id to a disk type.

lidEncodeType :: DiskLogicalId -> [(String, JSValue)]Source

Builds the extra disk_type field for a given logical id.

getStorageId :: DiskLogicalId -> Maybe StringSource

Returns the storage path or the unique name for a given logical id if present

getExtProvider :: DiskLogicalId -> Maybe StringSource

Returns the provider for ExtStorage and Nothing otherwise

encodeDLId :: DiskLogicalId -> JSValueSource

Custom encoder for DiskLogicalId (logical id only).

encodeFullDLId :: DiskLogicalId -> (JSValue, [(String, JSValue)])Source

Custom encoder for DiskLogicalId, composing both the logical id and the extra disk_type field.

decodeDLId :: [(String, JSValue)] -> JSValue -> Result DiskLogicalIdSource

Custom decoder for DiskLogicalId. This is manual for now, since we don't have yet automation for separate-key style fields.

data Disk Source

Disk data structure.

Instances

Eq Disk 
Show Disk 
JSON Disk 
ArrayObject Disk 
DictObject Disk 
SerialNoObject Disk 
ForthcomingObject Disk 
UuidObject Disk 
TimeStampObject Disk 
SerialNoObjectL Disk 
UuidObjectL Disk 
TimeStampObjectL Disk 
Arbitrary Disk

Disk arbitrary instance. Since we don't test disk hierarchy properties, we only generate disks with no children (FIXME), as generating recursive datastructures is a bit more work.

diskMtimeL :: Lens' Disk ClockTimeSource

diskCtimeL :: Lens' Disk ClockTimeSource

diskSerialL :: Lens' Disk IntSource

diskUuidL :: Lens' Disk ByteStringSource

diskSpindlesL :: Lens' Disk (Maybe Int)Source

diskNameL :: Lens' Disk (Maybe String)Source

diskSizeL :: Lens Disk Disk (Maybe Int) IntSource

diskIvNameL :: Lens' Disk StringSource

diskNodesL :: Lens' Disk [String]Source

diskMtime :: Disk -> ClockTimeSource

diskCtime :: Disk -> ClockTimeSource

diskUuid :: Disk -> ByteStringSource

diskSpindles :: Disk -> Maybe IntSource

diskName :: Disk -> Maybe StringSource

diskSize :: Disk -> Maybe IntSource

diskIvName :: Disk -> StringSource

diskNodes :: Disk -> [String]Source

includesLogicalId :: LogicalVolume -> Disk -> BoolSource

Determines whether a disk or one of his children has the given logical id (determined by the volume group name and by the logical volume name). This can be true only for DRBD or LVM disks.