Commit 9fa567b3 authored by René Nussbaumer's avatar René Nussbaumer
Browse files

gnt-node: Add instance policy to migrate


Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 2a84b7d3
......@@ -426,7 +426,8 @@ def MigrateNode(opts, args):
op = opcodes.OpNodeMigrate(node_name=args[0], mode=mode,
iallocator=opts.iallocator,
target_node=opts.dst_node)
target_node=opts.dst_node,
ignore_ipolicy=opts.ignore_ipolicy)
result = SubmitOpCode(op, cl=cl, opts=opts)
......@@ -899,7 +900,7 @@ commands = {
"migrate": (
MigrateNode, ARGS_ONE_NODE,
[FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, DST_NODE_OPT,
IALLOCATOR_OPT, PRIORITY_OPT],
IALLOCATOR_OPT, PRIORITY_OPT, IGNORE_IPOLICY_OPT],
"[-f] <node>",
"Migrate all the primary instance on a node away from it"
" (only for instances of type drbd)"),
......
......@@ -7612,7 +7612,8 @@ class LUNodeMigrate(LogicalUnit):
mode=self.op.mode,
live=self.op.live,
iallocator=self.op.iallocator,
target_node=self.op.target_node)]
target_node=self.op.target_node,
ignore_ipolicy=self.op.ignore_ipolicy)]
for inst in _GetNodePrimaryInstances(self.cfg, self.op.node_name)
]
 
......
......@@ -1046,6 +1046,7 @@ class OpNodeMigrate(OpCode):
_PMigrationMode,
_PMigrationLive,
_PMigrationTargetNode,
_PIgnoreIpolicy,
("iallocator", None, ht.TMaybeString,
"Iallocator for deciding the target node for shared-storage instances"),
]
......
......@@ -238,7 +238,7 @@ MIGRATE
~~~~~~~
**migrate** [-f] [--non-live] [--migration-mode=live\|non-live]
{*node*}
[--ignore-ipolicy] {*node*}
This command will migrate all instances having the given node as
primary to their secondary nodes. This works only for instances
......@@ -248,6 +248,9 @@ As for the **gnt-instance migrate** command, the options
``--no-live`` and ``--migration-mode`` can be given to influence
the migration type.
If ``--ignore-ipolicy`` is given any instance policy violations occuring
during this operation are ignored.
Example::
# gnt-node migrate node1.example.com
......
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