Revision 93e2e44e

b/lib/constants.py
1284 1284
NDC_DEFAULTS = _constants.NDC_DEFAULTS
1285 1285
NDC_GLOBALS = _constants.NDC_GLOBALS
1286 1286

  
1287
DISK_LD_DEFAULTS = {
1288
  DT_DRBD8: {
1289
    LDP_RESYNC_RATE: CLASSIC_DRBD_SYNC_SPEED,
1290
    LDP_BARRIERS: _constants.DRBD_BARRIERS,
1291
    LDP_NO_META_FLUSH: _constants.DRBD_NO_META_FLUSH,
1292
    LDP_DEFAULT_METAVG: DEFAULT_VG,
1293
    LDP_DISK_CUSTOM: "",
1294
    LDP_NET_CUSTOM: "",
1295
    LDP_PROTOCOL: DRBD_DEFAULT_NET_PROTOCOL,
1296
    LDP_DYNAMIC_RESYNC: False,
1297

  
1298
    # The default values for the DRBD dynamic resync speed algorithm
1299
    # are taken from the drbsetup 8.3.11 man page, except for
1300
    # c-plan-ahead (that we don't need to set to 0, because we have a
1301
    # separate option to enable it) and for c-max-rate, that we cap to
1302
    # the default value for the static resync rate.
1303
    LDP_PLAN_AHEAD: 20, # ds
1304
    LDP_FILL_TARGET: 0, # sectors
1305
    LDP_DELAY_TARGET: 1, # ds
1306
    LDP_MAX_RATE: CLASSIC_DRBD_SYNC_SPEED, # KiB/s
1307
    LDP_MIN_RATE: 4 * 1024, # KiB/s
1308
    },
1309
  DT_PLAIN: {
1310
    LDP_STRIPES: _constants.LVM_STRIPECOUNT
1311
    },
1312
  DT_FILE: {},
1313
  DT_SHARED_FILE: {},
1314
  DT_BLOCK: {},
1315
  DT_RBD: {
1316
    LDP_POOL: "rbd",
1317
    LDP_ACCESS: DISK_KERNELSPACE,
1318
    },
1319
  DT_EXT: {},
1320
  }
1287
DISK_LD_DEFAULTS = _constants.DISK_LD_DEFAULTS
1321 1288

  
1322 1289
# readability shortcuts
1323 1290
_LV_DEFAULTS = DISK_LD_DEFAULTS[DT_PLAIN]
b/src/Ganeti/HsConstants.hs
40 40
import Control.Arrow ((***))
41 41
import Data.List ((\\))
42 42
import Data.Map (Map)
43
import qualified Data.Map as Map (fromList, keys, insert)
43
import qualified Data.Map as Map (empty, fromList, keys, insert)
44 44

  
45 45
import qualified AutoConf
46 46
import Ganeti.ConstantUtils (PythonChar(..), FrozenSet, Protocol(..),
......
3482 3482
ndcGlobals :: FrozenSet String
3483 3483
ndcGlobals = ConstantUtils.mkSet [ndExclusiveStorage]
3484 3484

  
3485
diskLdDefaults :: Map DiskTemplate (Map String PyValueEx)
3486
diskLdDefaults =
3487
  Map.fromList
3488
  [ (DTDrbd8, Map.fromList
3489
              [ (ldpBarriers, PyValueEx drbdBarriers)
3490
              , (ldpDefaultMetavg, PyValueEx defaultVg)
3491
              , (ldpDelayTarget, PyValueEx (1 :: Int)) -- ds
3492
              , (ldpDiskCustom, PyValueEx "")
3493
              , (ldpDynamicResync, PyValueEx False)
3494
              , (ldpFillTarget, PyValueEx (0 :: Int)) -- sectors
3495
              , (ldpMaxRate, PyValueEx (classicDrbdSyncSpeed :: Int)) -- KiB/s
3496
              , (ldpMinRate, PyValueEx (4 * 1024 :: Int)) -- KiB/s
3497
              , (ldpNetCustom, PyValueEx "")
3498
              , (ldpNoMetaFlush, PyValueEx drbdNoMetaFlush)
3499
                -- The default values for the DRBD dynamic resync
3500
                -- speed algorithm are taken from the drbsetup 8.3.11
3501
                -- man page, except for c-plan-ahead (that we don't
3502
                -- need to set to 0, because we have a separate option
3503
                -- to enable it) and for c-max-rate, that we cap to
3504
                -- the default value for the static resync rate.
3505
              , (ldpPlanAhead, PyValueEx (20 :: Int)) -- ds
3506
              , (ldpProtocol, PyValueEx drbdDefaultNetProtocol)
3507
              , (ldpResyncRate, PyValueEx classicDrbdSyncSpeed)
3508
              ])
3509
  , (DTPlain, Map.fromList [(ldpStripes, PyValueEx lvmStripecount)])
3510
  , (DTFile, Map.empty)
3511
  , (DTSharedFile, Map.empty)
3512
  , (DTBlock, Map.empty)
3513
  , (DTRbd, Map.fromList
3514
            [ (ldpPool, PyValueEx "rbd")
3515
            , (ldpAccess, PyValueEx diskKernelspace)
3516
            ])
3517
  , (DTExt, Map.empty)
3518
  ]
3519

  
3485 3520
-- | All of the following values are quite arbitrary - there are no
3486 3521
-- "good" defaults, these must be customised per-site
3487 3522
ispecsMinmaxDefaults :: Map String (Map String Int)

Also available in: Unified diff