Revision 4c1275f9 src/Ganeti/HsConstants.hs

b/src/Ganeti/HsConstants.hs
530 530
defaultEnabledDiskTemplates :: [String]
531 531
defaultEnabledDiskTemplates = map Types.diskTemplateToRaw [DTDrbd8, DTPlain]
532 532

  
533
-- | The set of network-mirrored disk templates
534
dtsIntMirror :: FrozenSet String
535
dtsIntMirror = ConstantUtils.mkSet [dtDrbd8]
536

  
537
-- | 'DTDiskless' is 'trivially' externally mirrored
538
dtsExtMirror :: FrozenSet String
539
dtsExtMirror =
540
  ConstantUtils.mkSet $
541
  map Types.diskTemplateToRaw [DTDiskless, DTBlock, DTExt, DTSharedFile, DTRbd]
542

  
543
-- | The set of non-lvm-based disk templates
544
dtsNotLvm :: FrozenSet String
545
dtsNotLvm =
546
  ConstantUtils.mkSet $
547
  map Types.diskTemplateToRaw
548
  [DTSharedFile, DTDiskless, DTBlock, DTExt, DTFile, DTRbd]
549

  
550
-- | The set of disk templates which can be grown
551
dtsGrowable :: FrozenSet String
552
dtsGrowable =
553
  ConstantUtils.mkSet $
554
  map Types.diskTemplateToRaw
555
  [DTSharedFile, DTDrbd8, DTPlain, DTExt, DTFile, DTRbd]
556

  
557
-- | The set of disk templates that allow adoption
558
dtsMayAdopt :: FrozenSet String
559
dtsMayAdopt =
560
  ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTBlock, DTPlain]
561

  
562
-- | The set of disk templates that *must* use adoption
563
dtsMustAdopt :: FrozenSet String
564
dtsMustAdopt = ConstantUtils.mkSet [Types.diskTemplateToRaw DTBlock]
565

  
566
-- | The set of disk templates that allow migrations
567
dtsMirrored :: FrozenSet String
568
dtsMirrored = dtsIntMirror `ConstantUtils.union` dtsExtMirror
569

  
570
-- | The set of file based disk templates
571
dtsFilebased :: FrozenSet String
572
dtsFilebased =
573
  ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTSharedFile, DTFile]
574

  
575
-- | The set of disk templates that can be moved by copying
576
--
577
-- Note: a requirement is that they're not accessed externally or
578
-- shared between nodes; in particular, sharedfile is not suitable.
579
dtsCopyable :: FrozenSet String
580
dtsCopyable =
581
  ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain, DTFile]
582

  
583
-- | The set of disk templates that are supported by exclusive_storage
584
dtsExclStorage :: FrozenSet String
585
dtsExclStorage = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain]
586

  
587
-- | Templates for which we don't perform checks on free space
588
dtsNoFreeSpaceCheck :: FrozenSet String
589
dtsNoFreeSpaceCheck =
590
  ConstantUtils.mkSet $
591
  map Types.diskTemplateToRaw [DTExt, DTSharedFile, DTFile, DTRbd]
592

  
593
dtsBlock :: FrozenSet String
594
dtsBlock =
595
  ConstantUtils.mkSet $
596
  map Types.diskTemplateToRaw [DTPlain, DTDrbd8, DTBlock, DTRbd, DTExt]
597

  
533 598
-- * File backend driver
534 599

  
535 600
fdBlktap :: String

Also available in: Unified diff