Commit f9193417 authored by Iustin Pop's avatar Iustin Pop
Browse files

Remove the option to create md/drbd7 instances

This patch removes the options that allow to create local_raid1 or
remote_raid1 instances. It also modifies the documentation and removes
these disk templates from burnin and from qa.

Reviewed-by: imsnah
parent 249069a1
......@@ -2713,43 +2713,6 @@ def _GenerateDiskTemplate(cfg, template_name,
logical_id=(vgname, names[1]),
iv_name = "sdb")
disks = [sda_dev, sdb_dev]
elif template_name == constants.DT_LOCAL_RAID1:
if len(secondary_nodes) != 0:
raise errors.ProgrammerError("Wrong template configuration")
names = _GenerateUniqueNames(cfg, [".sda_m1", ".sda_m2",
".sdb_m1", ".sdb_m2"])
sda_dev_m1 = objects.Disk(dev_type=constants.LD_LV, size=disk_sz,
logical_id=(vgname, names[0]))
sda_dev_m2 = objects.Disk(dev_type=constants.LD_LV, size=disk_sz,
logical_id=(vgname, names[1]))
md_sda_dev = objects.Disk(dev_type=constants.LD_MD_R1, iv_name = "sda",
children = [sda_dev_m1, sda_dev_m2])
sdb_dev_m1 = objects.Disk(dev_type=constants.LD_LV, size=swap_sz,
logical_id=(vgname, names[2]))
sdb_dev_m2 = objects.Disk(dev_type=constants.LD_LV, size=swap_sz,
logical_id=(vgname, names[3]))
md_sdb_dev = objects.Disk(dev_type=constants.LD_MD_R1, iv_name = "sdb",
children = [sdb_dev_m1, sdb_dev_m2])
disks = [md_sda_dev, md_sdb_dev]
elif template_name == constants.DT_REMOTE_RAID1:
if len(secondary_nodes) != 1:
raise errors.ProgrammerError("Wrong template configuration")
remote_node = secondary_nodes[0]
names = _GenerateUniqueNames(cfg, [".sda_data", ".sda_meta",
".sdb_data", ".sdb_meta"])
drbd_sda_dev = _GenerateMDDRBDBranch(cfg, primary_node, remote_node,
disk_sz, names[0:2])
md_sda_dev = objects.Disk(dev_type=constants.LD_MD_R1, iv_name="sda",
children = [drbd_sda_dev], size=disk_sz)
drbd_sdb_dev = _GenerateMDDRBDBranch(cfg, primary_node, remote_node,
swap_sz, names[2:4])
md_sdb_dev = objects.Disk(dev_type=constants.LD_MD_R1, iv_name="sdb",
children = [drbd_sdb_dev], size=swap_sz)
disks = [md_sda_dev, md_sdb_dev]
elif template_name == constants.DT_DRBD8:
if len(secondary_nodes) != 1:
raise errors.ProgrammerError("Wrong template configuration")
......@@ -2960,9 +2923,7 @@ class LUCreateInstance(LogicalUnit):
req_size_dict = {
constants.DT_DISKLESS: None,
constants.DT_PLAIN: self.op.disk_size + self.op.swap_size,
constants.DT_LOCAL_RAID1: (self.op.disk_size + self.op.swap_size) * 2,
# 256 MB are added for drbd metadata, 128MB for each drbd device
constants.DT_REMOTE_RAID1: self.op.disk_size + self.op.swap_size + 256,
constants.DT_DRBD8: self.op.disk_size + self.op.swap_size + 256,
......@@ -85,8 +85,6 @@
<arg choice="req">-t<group>
......@@ -236,36 +234,12 @@
<para>Disk devices will be logical volumes.</para>
Disk devices will be md raid1 arrays over two local
logical volumes.
Disk devices will be md raid1 arrays with one
component (so it's not actually raid1): a drbd
(0.7.x) device between the instance's primary node
and the node given by the second value of the
<option>--node</option> option.
Disk devices will be drbd (version 8.x) on top of
lvm volumes. They are equivalent in functionality to
<replaceable>remote_raid1</replaceable>, but are
recommended for new instances (if you have drbd 8.x
lvm volumes.
......@@ -288,7 +262,7 @@
# gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
# gnt-instance add -t remote_raid1 -s 30g -m 512 -o debian-etch \
# gnt-instance add -t drbd -s 30g -m 512 -o debian-etch \
......@@ -268,16 +268,7 @@ def main():
RunTest(qa_instance.TestInstanceRemove, instance)
del instance
if qa_config.TestEnabled('instance-add-local-mirror-disk'):
instance = RunTest(qa_instance.TestInstanceAddWithLocalMirrorDisk, pnode)
RunExportImportTests(instance, pnode)
RunTest(qa_instance.TestInstanceRemove, instance)
del instance
multinode_tests = [
......@@ -49,13 +49,9 @@ tests:
node-failover: False
instance-add-plain-disk: True
instance-add-local-mirror-disk: True
# Requires DRBD 0.7.x
instance-add-remote-raid-disk: True
# Requires DRBD 8.x
instance-add-drbd-disk: False
instance-add-drbd-disk: True
instance-list: True
instance-failover: True
......@@ -76,7 +72,7 @@ tests:
# Other settings
burnin-instances: 2
burnin-disk-template: remote_raid1
burnin-disk-template: drbd
# Directory containing QA hooks
#hooks-dir: hooks/
......@@ -156,7 +156,7 @@ def TestClusterBurnin():
master = qa_config.GetMasterNode()
disk_template = (qa_config.get('options', {}).
get('burnin-disk-template', 'remote_raid1'))
get('burnin-disk-template', 'drbd'))
# Get as many instances as we need
instances = []
......@@ -54,11 +54,6 @@ def Validate():
if len(cfg['instances']) < 1:
raise qa_error.Error("Need at least one instance")
if (TestEnabled('instance-add-remote-raid-disk') and
raise qa_error.Error('Tests for disk templates remote_raid1 and drbd'
' cannot be enabled at the same time.')
def get(name, default=None):
return cfg.get(name, default)
......@@ -72,19 +72,6 @@ def TestInstanceAddWithPlainDisk(node):
return _DiskTest(node['primary'], 'plain')
def TestInstanceAddWithLocalMirrorDisk(node):
"""gnt-instance add -t local_raid1"""
return _DiskTest(node['primary'], 'local_raid1')
def TestInstanceAddWithRemoteRaidDisk(node, node2):
"""gnt-instance add -t remote_raid1"""
return _DiskTest("%s:%s" % (node['primary'], node2['primary']),
def TestInstanceAddWithDrbdDisk(node, node2):
"""gnt-instance add -t drbd"""
......@@ -726,8 +726,8 @@ add_opts = [
make_option("-p", "--cpu", dest="vcpus", help="Number of virtual CPUs",
default=1, type="int", metavar="<PROC>"),
make_option("-t", "--disk-template", dest="disk_template",
help="Custom disk setup (diskless, plain, local_raid1,"
" remote_raid1 or drbd)", default=None, metavar="TEMPL"),
help="Custom disk setup (diskless, plain, or drbd)",
default=None, metavar="TEMPL"),
make_option("-i", "--ip", dest="ip",
help="IP address ('none' [default], 'auto', or specify address)",
default='none', type="string", metavar="<ADDRESS>"),
......@@ -131,10 +131,9 @@ class Burner(object):
help="Skip instance stop/start", action="store_false",
parser.add_option("-t", "--disk-template", dest="disk_template",
choices=("diskless", "plain", "remote_raid1", "drbd"),
help="Template type for network mirroring (remote_raid1"
" or drbd) [remote_raid1]")
choices=("diskless", "plain", "drbd"),
help="Disk template (diskless, plain or drbd) [drbd]")
parser.add_option("-n", "--nodes", dest="nodes", default="",
help="Comma separated list of nodes to perform"
" the burnin on (defaults to all nodes)")
......@@ -143,8 +142,8 @@ class Burner(object):
if len(args) < 1 or options.os is None:
supported_disk_templates = (constants.DT_DISKLESS, constants.DT_PLAIN,
supported_disk_templates = (constants.DT_DISKLESS,
if options.disk_template not in supported_disk_templates:
Log("Unknown disk template '%s'" % options.disk_template)
......@@ -219,18 +218,6 @@ class Burner(object):
def ReplaceDisks1R1(self):
"""Replace disks with the same secondary for rr1."""
# replace all, both disks
for instance in self.instances:
op = opcodes.OpReplaceDisks(instance_name=instance,
disks=["sda", "sdb"])
Log("- Replace disks for instance %s" % (instance))
def ReplaceDisks1D8(self):
"""Replace disks on primary and secondary for drbd8."""
for instance in self.instances:
......@@ -243,10 +230,7 @@ class Burner(object):
def ReplaceDisks2(self):
"""Replace secondary node."""
if self.opts.disk_template == constants.DT_REMOTE_RAID1:
mode = constants.REPLACE_DISK_ALL
mode = constants.REPLACE_DISK_SEC
mode = constants.REPLACE_DISK_SEC
mytor = izip(islice(cycle(self.nodes), 2, None),
......@@ -352,10 +336,7 @@ class Burner(object):
if opts.do_replace1 and opts.disk_template in constants.DTS_NET_MIRROR:
if opts.disk_template == constants.DT_REMOTE_RAID1:
elif opts.disk_template == constants.DT_DRBD8:
if (opts.do_replace2 and len(self.nodes) > 2 and
opts.disk_template in constants.DTS_NET_MIRROR) :
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