diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py index f2fa3f79e0a9ca7ca2ef8c628b3168e2e41fb25b..9fff35ff0025916a61e2715603bcb7390ccb15d5 100644 --- a/lib/client/gnt_node.py +++ b/lib/client/gnt_node.py @@ -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)"), diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 38fb083c53dc9e7744db527ab0f6b0e5244e9462..b1f6f550fb994de15183ba376c14242f088abe39 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -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) ] diff --git a/lib/opcodes.py b/lib/opcodes.py index 3f6a845cc73d42c664732c690105f2325ba663d0..eb6a4de07795c1f4172aa4246ff4ee28edb1a954 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -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"), ] diff --git a/man/gnt-node.rst b/man/gnt-node.rst index 70a3a47c1ca8d57f806d282e464eb3a3774e535e..15b663cd0950dc94e6bc78f36101b2ee476032d9 100644 --- a/man/gnt-node.rst +++ b/man/gnt-node.rst @@ -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