Revision 8eb80cb3

b/lib/constants.py
697 697
DSS_PARAMETERS = _constants.DSS_PARAMETERS
698 698
DS_VALID_TYPES = _constants.DS_VALID_TYPES
699 699

  
700
BE_MEMORY = _constants.BE_MEMORY
701
BE_MAXMEM = _constants.BE_MAXMEM
702
BE_MINMEM = _constants.BE_MINMEM
703
BE_VCPUS = _constants.BE_VCPUS
704
BE_AUTO_BALANCE = _constants.BE_AUTO_BALANCE
705
BE_ALWAYS_FAILOVER = _constants.BE_ALWAYS_FAILOVER
706
BE_SPINDLE_USE = _constants.BE_SPINDLE_USE
707
BES_PARAMETER_TYPES = _constants.BES_PARAMETER_TYPES
708
BES_PARAMETER_TITLES = _constants.BES_PARAMETER_TITLES
709
BES_PARAMETER_COMPAT = _constants.BES_PARAMETER_COMPAT
710
BES_PARAMETERS = _constants.BES_PARAMETERS
711

  
700 712
ISPEC_MEM_SIZE = _constants.ISPEC_MEM_SIZE
701 713
ISPEC_CPU_COUNT = _constants.ISPEC_CPU_COUNT
702 714
ISPEC_DISK_COUNT = _constants.ISPEC_DISK_COUNT
......
728 740
NDS_PARAMETERS = _constants.NDS_PARAMETERS
729 741
NDS_PARAMETER_TITLES = _constants.NDS_PARAMETER_TITLES
730 742

  
731

  
732
# Backend parameter names
733
BE_MEMORY = "memory" # deprecated and replaced by max and min mem
734
BE_MAXMEM = "maxmem"
735
BE_MINMEM = "minmem"
736
BE_VCPUS = "vcpus"
737
BE_AUTO_BALANCE = "auto_balance"
738
BE_ALWAYS_FAILOVER = "always_failover"
739
BE_SPINDLE_USE = "spindle_use"
740

  
741
BES_PARAMETER_TYPES = {
742
  BE_MAXMEM: VTYPE_SIZE,
743
  BE_MINMEM: VTYPE_SIZE,
744
  BE_VCPUS: VTYPE_INT,
745
  BE_AUTO_BALANCE: VTYPE_BOOL,
746
  BE_ALWAYS_FAILOVER: VTYPE_BOOL,
747
  BE_SPINDLE_USE: VTYPE_INT,
748
  }
749

  
750
BES_PARAMETER_TITLES = {
751
  BE_AUTO_BALANCE: "Auto_balance",
752
  BE_MAXMEM: "ConfigMaxMem",
753
  BE_MINMEM: "ConfigMinMem",
754
  BE_VCPUS: "ConfigVCPUs",
755
  }
756

  
757
BES_PARAMETER_COMPAT = {
758
  BE_MEMORY: VTYPE_SIZE,
759
  }
760
BES_PARAMETER_COMPAT.update(BES_PARAMETER_TYPES)
761

  
762
BES_PARAMETERS = frozenset(BES_PARAMETER_TYPES.keys())
763

  
764
# Logical Disks parameters
765
LDP_RESYNC_RATE = "resync-rate"
766
LDP_STRIPES = "stripes"
767
LDP_BARRIERS = "disabled-barriers"
768
LDP_NO_META_FLUSH = "disable-meta-flush"
769
LDP_DEFAULT_METAVG = "default-metavg"
770
LDP_DISK_CUSTOM = "disk-custom"
771
LDP_NET_CUSTOM = "net-custom"
772
LDP_PROTOCOL = "protocol"
773
LDP_DYNAMIC_RESYNC = "dynamic-resync"
774
LDP_PLAN_AHEAD = "c-plan-ahead"
775
LDP_FILL_TARGET = "c-fill-target"
776
LDP_DELAY_TARGET = "c-delay-target"
777
LDP_MAX_RATE = "c-max-rate"
778
LDP_MIN_RATE = "c-min-rate"
779
LDP_POOL = "pool"
780
LDP_ACCESS = "access"
781
DISK_LD_TYPES = {
782
  LDP_RESYNC_RATE: VTYPE_INT,
783
  LDP_STRIPES: VTYPE_INT,
784
  LDP_BARRIERS: VTYPE_STRING,
785
  LDP_NO_META_FLUSH: VTYPE_BOOL,
786
  LDP_DEFAULT_METAVG: VTYPE_STRING,
787
  LDP_DISK_CUSTOM: VTYPE_STRING,
788
  LDP_NET_CUSTOM: VTYPE_STRING,
789
  LDP_PROTOCOL: VTYPE_STRING,
790
  LDP_DYNAMIC_RESYNC: VTYPE_BOOL,
791
  LDP_PLAN_AHEAD: VTYPE_INT,
792
  LDP_FILL_TARGET: VTYPE_INT,
793
  LDP_DELAY_TARGET: VTYPE_INT,
794
  LDP_MAX_RATE: VTYPE_INT,
795
  LDP_MIN_RATE: VTYPE_INT,
796
  LDP_POOL: VTYPE_STRING,
797
  LDP_ACCESS: VTYPE_STRING,
798
  }
799
DISK_LD_PARAMETERS = frozenset(DISK_LD_TYPES.keys())
743
LDP_RESYNC_RATE = _constants.LDP_RESYNC_RATE
744
LDP_STRIPES = _constants.LDP_STRIPES
745
LDP_BARRIERS = _constants.LDP_BARRIERS
746
LDP_NO_META_FLUSH = _constants.LDP_NO_META_FLUSH
747
LDP_DEFAULT_METAVG = _constants.LDP_DEFAULT_METAVG
748
LDP_DISK_CUSTOM = _constants.LDP_DISK_CUSTOM
749
LDP_NET_CUSTOM = _constants.LDP_NET_CUSTOM
750
LDP_PROTOCOL = _constants.LDP_PROTOCOL
751
LDP_DYNAMIC_RESYNC = _constants.LDP_DYNAMIC_RESYNC
752
LDP_PLAN_AHEAD = _constants.LDP_PLAN_AHEAD
753
LDP_FILL_TARGET = _constants.LDP_FILL_TARGET
754
LDP_DELAY_TARGET = _constants.LDP_DELAY_TARGET
755
LDP_MAX_RATE = _constants.LDP_MAX_RATE
756
LDP_MIN_RATE = _constants.LDP_MIN_RATE
757
LDP_POOL = _constants.LDP_POOL
758
LDP_ACCESS = _constants.LDP_ACCESS
759
DISK_LD_TYPES = _constants.DISK_LD_TYPES
760
DISK_LD_PARAMETERS = _constants.DISK_LD_PARAMETERS
800 761

  
801 762
# Disk template parameters (can be set/changed by the user via gnt-cluster and
802 763
# gnt-group)
b/src/Ganeti/HsConstants.hs
1705 1705
dsValidTypes :: FrozenSet String
1706 1706
dsValidTypes = ConstantUtils.mkSet [Types.diskTemplateToRaw DTPlain]
1707 1707

  
1708
-- Backend parameter names
1709

  
1710
beAlwaysFailover :: String
1711
beAlwaysFailover = "always_failover"
1712

  
1713
beAutoBalance :: String
1714
beAutoBalance = "auto_balance"
1715

  
1716
beMaxmem :: String
1717
beMaxmem = "maxmem"
1718

  
1719
-- | Deprecated and replaced by max and min mem
1720
beMemory :: String
1721
beMemory = "memory"
1722

  
1723
beMinmem :: String
1724
beMinmem = "minmem"
1725

  
1726
beSpindleUse :: String
1727
beSpindleUse = "spindle_use"
1728

  
1729
beVcpus :: String
1730
beVcpus = "vcpus"
1731

  
1732
besParameterTypes :: Map String VType
1733
besParameterTypes =
1734
  Map.fromList [(beAlwaysFailover, VTypeBool),
1735
                (beAutoBalance, VTypeBool),
1736
                (beMaxmem, VTypeSize),
1737
                (beMinmem, VTypeSize),
1738
                (beSpindleUse, VTypeInt),
1739
                (beVcpus, VTypeInt)]
1740

  
1741
besParameterTitles :: Map String String
1742
besParameterTitles =
1743
  Map.fromList [(beAutoBalance, "Auto_balance"),
1744
                (beMinmem, "ConfigMinMem"),
1745
                (beVcpus, "ConfigVCPUs"),
1746
                (beMaxmem, "ConfigMaxMem")]
1747

  
1748
besParameterCompat :: Map String VType
1749
besParameterCompat = Map.insert beMemory VTypeSize besParameterTypes
1750

  
1751
besParameters :: FrozenSet String
1752
besParameters =
1753
  ConstantUtils.mkSet [beAlwaysFailover,
1754
                       beAutoBalance,
1755
                       beMaxmem,
1756
                       beMinmem,
1757
                       beSpindleUse,
1758
                       beVcpus]
1759

  
1708 1760
-- | Instance specs
1709 1761
--
1710 1762
-- FIXME: these should be associated with 'Ganeti.HTools.Types.ISpec'
......
1825 1877
   (ndOvsName, "OpenvSwitchName"),
1826 1878
   (ndSpindleCount, "SpindleCount")]
1827 1879

  
1880
-- * Logical Disks parameters
1881

  
1882
ldpAccess :: String
1883
ldpAccess = "access"
1884

  
1885
ldpBarriers :: String
1886
ldpBarriers = "disabled-barriers"
1887

  
1888
ldpDefaultMetavg :: String
1889
ldpDefaultMetavg = "default-metavg"
1890

  
1891
ldpDelayTarget :: String
1892
ldpDelayTarget = "c-delay-target"
1893

  
1894
ldpDiskCustom :: String
1895
ldpDiskCustom = "disk-custom"
1896

  
1897
ldpDynamicResync :: String
1898
ldpDynamicResync = "dynamic-resync"
1828 1899

  
1900
ldpFillTarget :: String
1901
ldpFillTarget = "c-fill-target"
1829 1902

  
1903
ldpMaxRate :: String
1904
ldpMaxRate = "c-max-rate"
1830 1905

  
1906
ldpMinRate :: String
1907
ldpMinRate = "c-min-rate"
1831 1908

  
1909
ldpNetCustom :: String
1910
ldpNetCustom = "net-custom"
1832 1911

  
1912
ldpNoMetaFlush :: String
1913
ldpNoMetaFlush = "disable-meta-flush"
1914

  
1915
ldpPlanAhead :: String
1916
ldpPlanAhead = "c-plan-ahead"
1917

  
1918
ldpPool :: String
1919
ldpPool = "pool"
1920

  
1921
ldpProtocol :: String
1922
ldpProtocol = "protocol"
1923

  
1924
ldpResyncRate :: String
1925
ldpResyncRate = "resync-rate"
1926

  
1927
ldpStripes :: String
1928
ldpStripes = "stripes"
1929

  
1930
diskLdTypes :: Map String VType
1931
diskLdTypes =
1932
  Map.fromList
1933
  [(ldpAccess, VTypeString),
1934
   (ldpResyncRate, VTypeInt),
1935
   (ldpStripes, VTypeInt),
1936
   (ldpBarriers, VTypeString),
1937
   (ldpNoMetaFlush, VTypeBool),
1938
   (ldpDefaultMetavg, VTypeString),
1939
   (ldpDiskCustom, VTypeString),
1940
   (ldpNetCustom, VTypeString),
1941
   (ldpProtocol, VTypeString),
1942
   (ldpDynamicResync, VTypeBool),
1943
   (ldpPlanAhead, VTypeInt),
1944
   (ldpFillTarget, VTypeInt),
1945
   (ldpDelayTarget, VTypeInt),
1946
   (ldpMaxRate, VTypeInt),
1947
   (ldpMinRate, VTypeInt),
1948
   (ldpPool, VTypeString)]
1949

  
1950
diskLdParameters :: FrozenSet String
1951
diskLdParameters = ConstantUtils.mkSet (Map.keys diskLdTypes)
1833 1952

  
1834 1953
-- * OOB supported commands
1835 1954

  

Also available in: Unified diff