Commit 43e11798 authored by Andrea Spadaccini's avatar Andrea Spadaccini
Browse files

LV stripes parameters for plain and drbd



configure.ac:
* change the documentation of --with-lvm-stripecount parameter to
  reflect the change

doc/design-resource-model.rst:
* change drbd/stripes to drbd/data-stripes and drbd/metastripes to
  drbd/meta-stripes

rest of files:
* add the plain/stripes, drbd/data-stripes and drbd/meta-stripes disk
  parameters
Signed-off-by: default avatarAndrea Spadaccini <spadaccio@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 6e9814a1
......@@ -147,7 +147,7 @@ AC_SUBST(KVM_PATH, $kvm_path)
# --with-lvm-stripecount=...
AC_ARG_WITH([lvm-stripecount],
[AS_HELP_STRING([--with-lvm-stripecount=NUM],
[the number of stripes to use for LVM volumes]
[the default number of stripes to use for LVM volumes]
[ (default is 1)]
)],
[lvm_stripecount="$withval"],
......
......@@ -711,15 +711,15 @@ encoded via a separator (e.g. slash), or by having two dict levels.
| | |logical voumes |overridable at | |
| | | |runtime | |
+--------+-------------+-------------------------+---------------------+------+
|drbd |stripes |How many stripes to use |Same as for plain |int |
| | |for data volumes | | |
|drbd |data-stripes |How many stripes to use |Same as for |int |
| | |for data volumes |plain/stripes | |
+--------+-------------+-------------------------+---------------------+------+
|drbd |metavg |Default volume group for |Same as the main |string|
| | |the metadata LVs |volume group, | |
| | | |overridable via | |
| | | |'metavg' key | |
+--------+-------------+-------------------------+---------------------+------+
|drbd |metastripes |How many stripes to use |Same as for lvm |int |
|drbd |meta-stripes |How many stripes to use |Same as for lvm |int |
| | |for meta volumes |'stripes', suboptimal| |
| | | |as the meta LVs are | |
| | | |small | |
......
......@@ -415,7 +415,11 @@ class LogicalVolume(BlockDev):
" in lvm.conf using either 'filter' or 'preferred_names'")
free_size = sum([pv[0] for pv in pvs_info])
current_pvs = len(pvlist)
stripes = min(current_pvs, constants.LVM_STRIPECOUNT)
desired_stripes = params[constants.STRIPES]
stripes = min(current_pvs, desired_stripes)
if stripes < desired_stripes:
logging.warning("Could not use %d stripes for VG %s, as only %d PVs are"
" available.", desired_stripes, vg_name, current_pvs)
# The size constraint should have been checked from the master before
# calling the create function.
......
......@@ -8057,22 +8057,47 @@ def _ComputeLDParams(disk_template, disk_params):
result = list()
dt_params = disk_params[disk_template]
if disk_template == constants.DT_DRBD8:
params = {
drbd_params = {
constants.RESYNC_RATE: dt_params[constants.DRBD_RESYNC_RATE]
}
drbd_params = \
objects.FillDict(constants.DISK_LD_DEFAULTS[constants.LD_DRBD8], params)
objects.FillDict(constants.DISK_LD_DEFAULTS[constants.LD_DRBD8],
drbd_params)
result.append(drbd_params)
result.append(constants.DISK_LD_DEFAULTS[constants.LD_LV])
result.append(constants.DISK_LD_DEFAULTS[constants.LD_LV])
# data LV
data_params = {
constants.STRIPES: dt_params[constants.DRBD_DATA_STRIPES],
}
data_params = \
objects.FillDict(constants.DISK_LD_DEFAULTS[constants.LD_LV],
data_params)
result.append(data_params)
# metadata LV
meta_params = {
constants.STRIPES: dt_params[constants.DRBD_META_STRIPES],
}
meta_params = \
objects.FillDict(constants.DISK_LD_DEFAULTS[constants.LD_LV],
meta_params)
result.append(meta_params)
elif (disk_template == constants.DT_FILE or
disk_template == constants.DT_SHARED_FILE):
result.append(constants.DISK_LD_DEFAULTS[constants.LD_FILE])
elif disk_template == constants.DT_PLAIN:
result.append(constants.DISK_LD_DEFAULTS[constants.LD_LV])
params = {
constants.STRIPES: dt_params[constants.LV_STRIPES],
}
params = \
objects.FillDict(constants.DISK_LD_DEFAULTS[constants.LD_LV],
params)
result.append(params)
elif disk_template == constants.DT_BLOCK:
result.append(constants.DISK_LD_DEFAULTS[constants.LD_BLOCKDEV])
......
......@@ -611,7 +611,6 @@ DEFAULT_VG = "xenvg"
DEFAULT_DRBD_HELPER = "/bin/true"
MIN_VG_SIZE = 20480
DEFAULT_MAC_PREFIX = "aa:00:00"
LVM_STRIPECOUNT = _autoconf.LVM_STRIPECOUNT
# default maximum instance wait time, in seconds.
DEFAULT_SHUTDOWN_TIMEOUT = 120
NODE_MAX_CLOCK_SKEW = 150
......@@ -898,15 +897,23 @@ NDS_PARAMETERS = frozenset(NDS_PARAMETER_TYPES.keys())
# Logical Disks parameters
RESYNC_RATE = "resync-rate"
STRIPES = "stripes"
DISK_LD_TYPES = {
RESYNC_RATE: VTYPE_INT,
STRIPES: VTYPE_INT,
}
DISK_LD_PARAMETERS = frozenset(DISK_LD_TYPES.keys())
# Disk template parameters
DRBD_RESYNC_RATE = "resync-rate"
DRBD_DATA_STRIPES = "data-stripes"
DRBD_META_STRIPES = "meta-stripes"
LV_STRIPES = "stripes"
DISK_DT_TYPES = {
DRBD_RESYNC_RATE: VTYPE_INT,
DRBD_DATA_STRIPES: VTYPE_INT,
DRBD_META_STRIPES: VTYPE_INT,
LV_STRIPES: VTYPE_INT,
}
DISK_DT_PARAMETERS = frozenset(DISK_DT_TYPES.keys())
......@@ -1678,6 +1685,7 @@ DISK_LD_DEFAULTS = {
RESYNC_RATE: CLASSIC_DRBD_SYNC_SPEED,
},
LD_LV: {
STRIPES: _autoconf.LVM_STRIPECOUNT
},
LD_FILE: {
},
......@@ -1687,9 +1695,12 @@ DISK_LD_DEFAULTS = {
DISK_DT_DEFAULTS = {
DT_PLAIN: {
LV_STRIPES: DISK_LD_DEFAULTS[LD_LV][STRIPES],
},
DT_DRBD8: {
DRBD_RESYNC_RATE: DISK_LD_DEFAULTS[LD_DRBD8][RESYNC_RATE]
DRBD_RESYNC_RATE: DISK_LD_DEFAULTS[LD_DRBD8][RESYNC_RATE],
DRBD_DATA_STRIPES: DISK_LD_DEFAULTS[LD_LV][STRIPES],
DRBD_META_STRIPES: DISK_LD_DEFAULTS[LD_LV][STRIPES],
},
DT_DISKLESS: {
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment