Revision 43e11798

b/configure.ac
147 147
# --with-lvm-stripecount=...
148 148
AC_ARG_WITH([lvm-stripecount],
149 149
  [AS_HELP_STRING([--with-lvm-stripecount=NUM],
150
    [the number of stripes to use for LVM volumes]
150
    [the default number of stripes to use for LVM volumes]
151 151
    [ (default is 1)]
152 152
  )],
153 153
  [lvm_stripecount="$withval"],
b/doc/design-resource-model.rst
711 711
|        |             |logical voumes           |overridable at       |      |
712 712
|        |             |                         |runtime              |      |
713 713
+--------+-------------+-------------------------+---------------------+------+
714
|drbd    |stripes      |How many stripes to use  |Same as for plain    |int   |
715
|        |             |for data volumes         |                     |      |
714
|drbd    |data-stripes |How many stripes to use  |Same as for          |int   |
715
|        |             |for data volumes         |plain/stripes        |      |
716 716
+--------+-------------+-------------------------+---------------------+------+
717 717
|drbd    |metavg       |Default volume group for |Same as the main     |string|
718 718
|        |             |the metadata LVs         |volume group,        |      |
719 719
|        |             |                         |overridable via      |      |
720 720
|        |             |                         |'metavg' key         |      |
721 721
+--------+-------------+-------------------------+---------------------+------+
722
|drbd    |metastripes  |How many stripes to use  |Same as for lvm      |int   |
722
|drbd    |meta-stripes |How many stripes to use  |Same as for lvm      |int   |
723 723
|        |             |for meta volumes         |'stripes', suboptimal|      |
724 724
|        |             |                         |as the meta LVs are  |      |
725 725
|        |             |                         |small                |      |
b/lib/bdev.py
415 415
                  " in lvm.conf using either 'filter' or 'preferred_names'")
416 416
    free_size = sum([pv[0] for pv in pvs_info])
417 417
    current_pvs = len(pvlist)
418
    stripes = min(current_pvs, constants.LVM_STRIPECOUNT)
418
    desired_stripes = params[constants.STRIPES]
419
    stripes = min(current_pvs, desired_stripes)
420
    if stripes < desired_stripes:
421
      logging.warning("Could not use %d stripes for VG %s, as only %d PVs are"
422
                      " available.", desired_stripes, vg_name, current_pvs)
419 423

  
420 424
    # The size constraint should have been checked from the master before
421 425
    # calling the create function.
b/lib/cmdlib.py
8057 8057
  result = list()
8058 8058
  dt_params = disk_params[disk_template]
8059 8059
  if disk_template == constants.DT_DRBD8:
8060
    params = {
8060
    drbd_params = {
8061 8061
      constants.RESYNC_RATE: dt_params[constants.DRBD_RESYNC_RATE]
8062 8062
      }
8063 8063

  
8064 8064
    drbd_params = \
8065
      objects.FillDict(constants.DISK_LD_DEFAULTS[constants.LD_DRBD8], params)
8065
      objects.FillDict(constants.DISK_LD_DEFAULTS[constants.LD_DRBD8],
8066
                       drbd_params)
8066 8067

  
8067 8068
    result.append(drbd_params)
8068
    result.append(constants.DISK_LD_DEFAULTS[constants.LD_LV])
8069
    result.append(constants.DISK_LD_DEFAULTS[constants.LD_LV])
8069

  
8070
    # data LV
8071
    data_params = {
8072
      constants.STRIPES: dt_params[constants.DRBD_DATA_STRIPES],
8073
      }
8074
    data_params = \
8075
      objects.FillDict(constants.DISK_LD_DEFAULTS[constants.LD_LV],
8076
                       data_params)
8077
    result.append(data_params)
8078

  
8079
    # metadata LV
8080
    meta_params = {
8081
      constants.STRIPES: dt_params[constants.DRBD_META_STRIPES],
8082
      }
8083
    meta_params = \
8084
      objects.FillDict(constants.DISK_LD_DEFAULTS[constants.LD_LV],
8085
                       meta_params)
8086
    result.append(meta_params)
8070 8087

  
8071 8088
  elif (disk_template == constants.DT_FILE or
8072 8089
        disk_template == constants.DT_SHARED_FILE):
8073 8090
    result.append(constants.DISK_LD_DEFAULTS[constants.LD_FILE])
8091

  
8074 8092
  elif disk_template == constants.DT_PLAIN:
8075
    result.append(constants.DISK_LD_DEFAULTS[constants.LD_LV])
8093
    params = {
8094
      constants.STRIPES: dt_params[constants.LV_STRIPES],
8095
      }
8096
    params = \
8097
      objects.FillDict(constants.DISK_LD_DEFAULTS[constants.LD_LV],
8098
                       params)
8099
    result.append(params)
8100

  
8076 8101
  elif disk_template == constants.DT_BLOCK:
8077 8102
    result.append(constants.DISK_LD_DEFAULTS[constants.LD_BLOCKDEV])
8078 8103

  
b/lib/constants.py
611 611
DEFAULT_DRBD_HELPER = "/bin/true"
612 612
MIN_VG_SIZE = 20480
613 613
DEFAULT_MAC_PREFIX = "aa:00:00"
614
LVM_STRIPECOUNT = _autoconf.LVM_STRIPECOUNT
615 614
# default maximum instance wait time, in seconds.
616 615
DEFAULT_SHUTDOWN_TIMEOUT = 120
617 616
NODE_MAX_CLOCK_SKEW = 150
......
898 897

  
899 898
# Logical Disks parameters
900 899
RESYNC_RATE = "resync-rate"
900
STRIPES = "stripes"
901 901
DISK_LD_TYPES = {
902 902
  RESYNC_RATE: VTYPE_INT,
903
  STRIPES: VTYPE_INT,
903 904
  }
904 905
DISK_LD_PARAMETERS = frozenset(DISK_LD_TYPES.keys())
905 906

  
906 907
# Disk template parameters
907 908
DRBD_RESYNC_RATE = "resync-rate"
909
DRBD_DATA_STRIPES = "data-stripes"
910
DRBD_META_STRIPES = "meta-stripes"
911
LV_STRIPES = "stripes"
908 912
DISK_DT_TYPES = {
909 913
  DRBD_RESYNC_RATE: VTYPE_INT,
914
  DRBD_DATA_STRIPES: VTYPE_INT,
915
  DRBD_META_STRIPES: VTYPE_INT,
916
  LV_STRIPES: VTYPE_INT,
910 917
  }
911 918

  
912 919
DISK_DT_PARAMETERS = frozenset(DISK_DT_TYPES.keys())
......
1678 1685
    RESYNC_RATE: CLASSIC_DRBD_SYNC_SPEED,
1679 1686
    },
1680 1687
  LD_LV: {
1688
    STRIPES: _autoconf.LVM_STRIPECOUNT
1681 1689
    },
1682 1690
  LD_FILE: {
1683 1691
    },
......
1687 1695

  
1688 1696
DISK_DT_DEFAULTS = {
1689 1697
  DT_PLAIN: {
1698
    LV_STRIPES: DISK_LD_DEFAULTS[LD_LV][STRIPES],
1690 1699
    },
1691 1700
  DT_DRBD8: {
1692
    DRBD_RESYNC_RATE: DISK_LD_DEFAULTS[LD_DRBD8][RESYNC_RATE]
1701
    DRBD_RESYNC_RATE: DISK_LD_DEFAULTS[LD_DRBD8][RESYNC_RATE],
1702
    DRBD_DATA_STRIPES: DISK_LD_DEFAULTS[LD_LV][STRIPES],
1703
    DRBD_META_STRIPES: DISK_LD_DEFAULTS[LD_LV][STRIPES],
1693 1704
    },
1694 1705
  DT_DISKLESS: {
1695 1706
    },

Also available in: Unified diff