Commit 5b9107ff authored by Iustin Pop's avatar Iustin Pop
Browse files

Add burnin support for instance moves



This patch adds support for instance moves in burnin. This means that
non-drbd instances finally get support for being moved.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 46af447b
......@@ -128,6 +128,9 @@ OPTIONS = [
cli.cli_option("--no-migrate", dest="do_migrate",
help="Skip instance live migration",
action="store_false", default=True),
cli.cli_option("--no-move", dest="do_move",
help="Skip instance moves", action="store_false",
default=True),
cli.cli_option("--no-importexport", dest="do_importexport",
help="Skip instance export/import", action="store_false",
default=True),
......@@ -562,7 +565,19 @@ class Burner(object):
Log("instance %s" % instance, indent=1)
op = opcodes.OpFailoverInstance(instance_name=instance,
ignore_consistency=False)
self.ExecOrQueue(instance, op)
@_DoCheckInstances
@_DoBatch(False)
def BurnMove(self):
"""Move the instances."""
Log("Moving instances")
mytor = izip(islice(cycle(self.nodes), 1, None),
self.instances)
for tnode, instance in mytor:
Log("instance %s" % instance, indent=1)
op = opcodes.OpMoveInstance(instance_name=instance,
target_node=tnode)
self.ExecOrQueue(instance, op)
@_DoBatch(False)
......@@ -845,6 +860,10 @@ class Burner(object):
if opts.do_migrate and opts.disk_template == constants.DT_DRBD8:
self.BurnMigrate()
if opts.do_move and opts.disk_template in [constants.DT_PLAIN,
constants.DT_FILE]:
self.BurnMove()
if (opts.do_importexport and
opts.disk_template not in (constants.DT_DISKLESS,
constants.DT_FILE)):
......
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