Commit 8002e46b authored by Andrea Spadaccini's avatar Andrea Spadaccini
Browse files

Add the metavg DRBD disk parameter



This parameter represents the default metadata volume group for DRBD
disks. It can be overridden at instance creation time using the metavg
instance disk parameter.
Signed-off-by: default avatarAndrea Spadaccini <spadaccio@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent ac00bf1b
......@@ -8172,6 +8172,7 @@ def _ComputeLDParams(disk_template, disk_params):
constants.LDP_RESYNC_RATE: dt_params[constants.DRBD_RESYNC_RATE],
constants.LDP_BARRIERS: dt_params[constants.DRBD_DISK_BARRIERS],
constants.LDP_NO_META_FLUSH: dt_params[constants.DRBD_META_BARRIERS],
constants.LDP_DEFAULT_METAVG: dt_params[constants.DRBD_DEFAULT_METAVG],
}
drbd_params = \
......@@ -8290,8 +8291,9 @@ def _GenerateDiskTemplate(lu, template_name,
names.append(lv_prefix + "_meta")
for idx, disk in enumerate(disk_info):
disk_index = idx + base_index
drbd_default_metavg = drbd_params[constants.LDP_DEFAULT_METAVG]
data_vg = disk.get(constants.IDISK_VG, vgname)
meta_vg = disk.get(constants.IDISK_METAVG, data_vg)
meta_vg = disk.get(constants.IDISK_METAVG, drbd_default_metavg)
disk_dev = _GenerateDRBD8Branch(lu, primary_node, remote_node,
disk[constants.IDISK_SIZE],
[data_vg, meta_vg],
......@@ -9301,8 +9303,9 @@ class LUInstanceCreate(LogicalUnit):
constants.IDISK_SIZE: size,
constants.IDISK_MODE: mode,
constants.IDISK_VG: data_vg,
constants.IDISK_METAVG: disk.get(constants.IDISK_METAVG, data_vg),
}
if constants.IDISK_METAVG in disk:
new_disk[constants.IDISK_METAVG] = disk[constants.IDISK_METAVG]
if constants.IDISK_ADOPT in disk:
new_disk[constants.IDISK_ADOPT] = disk[constants.IDISK_ADOPT]
self.disks.append(new_disk)
......
......@@ -935,11 +935,13 @@ LDP_RESYNC_RATE = "resync-rate"
LDP_STRIPES = "stripes"
LDP_BARRIERS = "disabled-barriers"
LDP_NO_META_FLUSH = "disable-meta-flush"
LDP_DEFAULT_METAVG = "default-metavg"
DISK_LD_TYPES = {
LDP_RESYNC_RATE: VTYPE_INT,
LDP_STRIPES: VTYPE_INT,
LDP_BARRIERS: VTYPE_STRING,
LDP_NO_META_FLUSH: VTYPE_BOOL,
LDP_DEFAULT_METAVG: VTYPE_STRING,
}
DISK_LD_PARAMETERS = frozenset(DISK_LD_TYPES.keys())
......@@ -949,6 +951,7 @@ DRBD_DATA_STRIPES = "data-stripes"
DRBD_META_STRIPES = "meta-stripes"
DRBD_DISK_BARRIERS = "disk-barriers"
DRBD_META_BARRIERS = "meta-barriers"
DRBD_DEFAULT_METAVG = "metavg"
LV_STRIPES = "stripes"
DISK_DT_TYPES = {
DRBD_RESYNC_RATE: VTYPE_INT,
......@@ -956,6 +959,7 @@ DISK_DT_TYPES = {
DRBD_META_STRIPES: VTYPE_INT,
DRBD_DISK_BARRIERS: VTYPE_STRING,
DRBD_META_BARRIERS: VTYPE_BOOL,
DRBD_DEFAULT_METAVG: VTYPE_STRING,
LV_STRIPES: VTYPE_INT,
}
......@@ -1729,6 +1733,7 @@ DISK_LD_DEFAULTS = {
LDP_RESYNC_RATE: CLASSIC_DRBD_SYNC_SPEED,
LDP_BARRIERS: _autoconf.DRBD_BARRIERS,
LDP_NO_META_FLUSH: _autoconf.DRBD_NO_META_FLUSH,
LDP_DEFAULT_METAVG: DEFAULT_VG,
},
LD_LV: {
LDP_STRIPES: _autoconf.LVM_STRIPECOUNT
......@@ -1749,6 +1754,7 @@ DISK_DT_DEFAULTS = {
DRBD_META_STRIPES: DISK_LD_DEFAULTS[LD_LV][LDP_STRIPES],
DRBD_DISK_BARRIERS: DISK_LD_DEFAULTS[LD_DRBD8][LDP_BARRIERS],
DRBD_META_BARRIERS: DISK_LD_DEFAULTS[LD_DRBD8][LDP_NO_META_FLUSH],
DRBD_DEFAULT_METAVG: DISK_LD_DEFAULTS[LD_DRBD8][LDP_DEFAULT_METAVG],
},
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