Commit c812ab71 authored by Klaus Aehlig's avatar Klaus Aehlig

Support sequential evacuation

Make gnt-group evacuate support the --sequential option,
which causes all evacuation moves to be execuated sequentially.
This can be used to avoid congestion on a possibly slow link
between the node groups.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent ed9c2202
......@@ -242,7 +242,8 @@ def EvacuateGroup(opts, args):
op = opcodes.OpGroupEvacuate(group_name=group_name,
iallocator=opts.iallocator,
target_groups=opts.to,
early_release=opts.early_release)
early_release=opts.early_release,
sequential=opts.sequential)
result = SubmitOrSend(op, opts, cl=cl)
# Keep track of submitted jobs
......@@ -358,7 +359,8 @@ commands = {
"[--dry-run] <group-name> <new-name>", "Rename a node group"),
"evacuate": (
EvacuateGroup, [ArgGroup(min=1, max=1)],
[TO_GROUP_OPT, IALLOCATOR_OPT, EARLY_RELEASE_OPT] + SUBMIT_OPTS,
[TO_GROUP_OPT, IALLOCATOR_OPT, EARLY_RELEASE_OPT, SEQUENTIAL_OPT]
+ SUBMIT_OPTS,
"[-I <iallocator>] [--to <group>]",
"Evacuate all instances within a group"),
"list-tags": (
......
......@@ -856,6 +856,12 @@ class LUGroupEvacuate(LogicalUnit):
self.LogInfo("Iallocator returned %s job(s) for evacuating node group %s",
len(jobs), self.op.group_name)
if self.op.sequential:
self.LogInfo("Jobs will be submitted to run sequentially")
for job in jobs[1:]:
for op in job:
op.depends = [(-1, ["error", "success"])]
return ResultWithJobs(jobs)
......
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