Skip to content
Snippets Groups Projects
Commit 99bdd139 authored by Iustin Pop's avatar Iustin Pop
Browse files

Forward port of the burnin migration

This is again a copy of the latest 1.2 burnin code related to migration.

Reviewed-by: ultrotter
parent 53c776b5
No related branches found
No related tags found
No related merge requests found
...@@ -165,6 +165,9 @@ class Burner(object): ...@@ -165,6 +165,9 @@ class Burner(object):
parser.add_option("--no-failover", dest="do_failover", parser.add_option("--no-failover", dest="do_failover",
help="Skip instance failovers", action="store_false", help="Skip instance failovers", action="store_false",
default=True) default=True)
parser.add_option("--no-migrate", dest="do_migrate",
help="Skip instance live migration",
action="store_false", default=True)
parser.add_option("--no-importexport", dest="do_importexport", parser.add_option("--no-importexport", dest="do_importexport",
help="Skip instance export/import", action="store_false", help="Skip instance export/import", action="store_false",
default=True) default=True)
...@@ -403,6 +406,22 @@ class Burner(object): ...@@ -403,6 +406,22 @@ class Burner(object):
for instance in self.instances: for instance in self.instances:
self._CheckInstanceAlive(instance) self._CheckInstanceAlive(instance)
def Migrate(self):
"""Migrate the instances."""
for instance in self.instances:
op = opcodes.OpMigrateInstance(instance_name=instance, live=True,
cleanup=False)
Log("- Migrate instance %s" % (instance))
self.ExecOp(op)
for instance in self.instances:
op = opcodes.OpMigrateInstance(instance_name=instance, live=True,
cleanup=True)
Log("- Testing 'migrate --cleanup' for instance %s" % (instance))
self.ExecOp(op)
def ImportExport(self): def ImportExport(self):
"""Export the instance, delete it, and import it back. """Export the instance, delete it, and import it back.
...@@ -671,6 +690,9 @@ class Burner(object): ...@@ -671,6 +690,9 @@ class Burner(object):
if opts.do_failover and opts.disk_template in constants.DTS_NET_MIRROR: if opts.do_failover and opts.disk_template in constants.DTS_NET_MIRROR:
self.Failover() self.Failover()
if opts.do_migrate and opts.disk_template == constants.DT_DRBD8:
self.Migrate()
if (opts.do_importexport and if (opts.do_importexport and
opts.disk_template not in (constants.DT_DISKLESS, opts.disk_template not in (constants.DT_DISKLESS,
constants.DT_FILE)): constants.DT_FILE)):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment