On Wed, May 25, 2011 at 04:45:50PM +0200, Michael Hanselmann wrote:
> Commit aac4511a added CheckArguments to LUNodeMigrate with a call to
> _CheckIAllocatorOrNode. When no default iallocator is defined,
> evacuating a node would always fail:
> 
> Migrate instance(s) '...'?
> y/[n]/?: y
> Failure: prerequisites not met for this operation:
> No iallocator or node given and no cluster-wide default iallocator
> found; please specify either an iallocator or a node, or set a
> cluster-wide default iallocator
> 
> This patch adds a new parameter to specify a target node. This doesn't
> solve all issues, but will make the most important cases work again in
> the meantime. This opcode will receive more work for node group support.
> 
> Signed-off-by: Michael Hanselmann <[email protected]>
> ---
>  lib/client/gnt_node.py |    5 +++--
>  lib/cmdlib.py          |    2 +-
>  lib/opcodes.py         |   11 +++++++----
>  3 files changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py
> index 6ddc9e4..0b0dbf1 100644
> --- a/lib/client/gnt_node.py
> +++ b/lib/client/gnt_node.py
> @@ -386,7 +386,8 @@ def MigrateNode(opts, args):
>    else:
>      mode = opts.migration_mode
>    op = opcodes.OpNodeMigrate(node_name=args[0], mode=mode,
> -                             iallocator=opts.iallocator)
> +                             iallocator=opts.iallocator,
> +                             target_node=opts.dst_node)
>    SubmitOpCode(op, cl=cl, opts=opts)
>  
>  
> @@ -829,7 +830,7 @@ commands = {
>      " secondary node (only for instances with drbd disk template)"),
>    'migrate': (
>      MigrateNode, ARGS_ONE_NODE,
> -    [FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT,
> +    [FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, DST_NODE_OPT,
>       IALLOCATOR_OPT, PRIORITY_OPT],
>      "[-f] <node>",
>      "Migrate all the primary instance on a node away from it"
> diff --git a/lib/cmdlib.py b/lib/cmdlib.py
> index f65b3d0..d83a448 100644
> --- a/lib/cmdlib.py
> +++ b/lib/cmdlib.py
> @@ -6648,7 +6648,7 @@ class LUNodeMigrate(LogicalUnit):
>    REQ_BGL = False
>  
>    def CheckArguments(self):
> -    _CheckIAllocatorOrNode(self, "iallocator", "remote_node")
> +    pass

Is this still needed?

iustin

Reply via email to