Revision b906d7c1 htools/Ganeti/HTools/Types.hs

b/htools/Ganeti/HTools/Types.hs
58 58
  , DiskTemplate(..)
59 59
  , diskTemplateToRaw
60 60
  , diskTemplateFromRaw
61
  , MirrorType(..)
62
  , templateMirrorType
61 63
  , MoveJob
62 64
  , JobSet
63 65
  , Result(..)
......
124 126
       ])
125 127
$(THH.makeJSONInstance ''DiskTemplate)
126 128

  
129
-- | Mirroring type.
130
data MirrorType = MirrorNone     -- ^ No mirroring/movability
131
                | MirrorInternal -- ^ DRBD-type mirroring
132
                | MirrorExternal -- ^ Shared-storage type mirroring
133
                  deriving (Eq, Show, Read)
134

  
135
-- | Correspondence between disk template and mirror type.
136
templateMirrorType :: DiskTemplate -> MirrorType
137
templateMirrorType DTDiskless   = MirrorExternal
138
templateMirrorType DTFile       = MirrorNone
139
templateMirrorType DTSharedFile = MirrorExternal
140
templateMirrorType DTPlain      = MirrorNone
141
templateMirrorType DTBlock      = MirrorExternal
142
templateMirrorType DTDrbd8      = MirrorInternal
143
templateMirrorType DTRbd        = MirrorExternal
144

  
127 145
-- | The Group allocation policy type.
128 146
--
129 147
-- Note that the order of constructors is important as the automatic

Also available in: Unified diff