On Thu, May 12, 2011 at 02:02:59PM +0200, Rene Nussbaumer wrote:
> On Thu, May 12, 2011 at 1:41 PM, Iustin Pop <[email protected]> wrote:
> > The opcode parameter ignore_consistency was used in the LU, but not
> > actually declared in the OpCode. The patch adds it in the opcode and
> > the command line client.
> >
> > ObQuote—Please, please, can I have static typing?
> > ---
> >  lib/client/gnt_instance.py |    5 +++--
> >  lib/opcodes.py             |    1 +
> >  man/gnt-instance.rst       |    7 ++++++-
> >  3 files changed, 10 insertions(+), 3 deletions(-)
> >
> > diff --git a/lib/client/gnt_instance.py b/lib/client/gnt_instance.py
> > index 8b7e82b..3ee4b85 100644
> > --- a/lib/client/gnt_instance.py
> > +++ b/lib/client/gnt_instance.py
> > @@ -883,7 +883,8 @@ def MoveInstance(opts, args):
> >
> >   op = opcodes.OpInstanceMove(instance_name=instance_name,
> >                               target_node=opts.node,
> > -                              shutdown_timeout=opts.shutdown_timeout)
> > +                              shutdown_timeout=opts.shutdown_timeout,
> > +                              ignore_consistency=opts.ignore_consistency)
> >   SubmitOrSend(op, opts, cl=cl)
> >   return 0
> >
> > @@ -1399,7 +1400,7 @@ commands = {
> >   'move': (
> >     MoveInstance, ARGS_ONE_INSTANCE,
> >     [FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT, SHUTDOWN_TIMEOUT_OPT,
> > -     DRY_RUN_OPT, PRIORITY_OPT],
> > +     DRY_RUN_OPT, PRIORITY_OPT, IGNORE_CONSIST_OPT],
> >     "[-f] <instance>", "Move instance to an arbitrary node"
> >     " (only for instances of type file and lv)"),
> >   'info': (
> > diff --git a/lib/opcodes.py b/lib/opcodes.py
> > index 5362895..d04c969 100644
> > --- a/lib/opcodes.py
> > +++ b/lib/opcodes.py
> > @@ -919,6 +919,7 @@ class OpInstanceMove(OpCode):
> >   OP_PARAMS = [
> >     _PInstanceName,
> >     _PShutdownTimeout,
> > +    _PIgnoreConsistency,
> >     ("target_node", ht.NoDefault, ht.TNonEmptyString),
> >     ]
> >
> > diff --git a/man/gnt-instance.rst b/man/gnt-instance.rst
> > index c9224c6..0d6dde5 100644
> > --- a/man/gnt-instance.rst
> > +++ b/man/gnt-instance.rst
> > @@ -1456,7 +1456,8 @@ Example (and expected output)::
> >  MOVE
> >  ^^^^
> >
> > -**move** [-f] [-n *node*] [--shutdown-timeout=*N*] [--submit]
> > +**move** [-f] [--ignore-consistency]
> > +[-n *node*] [--shutdown-timeout=*N*] [--submit]
> >  {*instance*}
> >
> >  Move will move the instance to an arbitrary node in the cluster.  This
> > @@ -1471,6 +1472,10 @@ before forcing the shutdown (e.g. ``xm destroy`` in 
> > XEN, killing the
> >  kvm process for KVM, etc.). By default two minutes are given to each
> >  instance to stop.
> >
> > +The ``--ignore-consistency`` option will make Ganeti ignore any errors
> > +in trying to shutdown the instance on its node; useful if the
> > +hypervisor is broken and you want to recuperate the data.
> > +
> >  The ``--submit`` option is used to send the job to the master daemon
> >  but not wait for its completion. The job ID will be shown so that it
> >  can be examined via **gnt-job info**.
> > --
> > 1.7.3.1
> 
> LGTM

Thanks. Will add this to NEWS:

diff --git a/NEWS b/NEWS
index 09b18a1..3703a28 100644
--- a/NEWS
+++ b/NEWS
@@ -72,6 +72,9 @@ Many bug-fixes and a few new small features:
 - Fixed the handling of a corner case when the Python installation gets
   corrupted (e.g. a bad disk) while ganeti-noded is running and we try
   to execute a command that doesn't exist
+- Fixed a bug in ``gnt-instance move`` (LUInstanceMove) when the primary
+  node of the instance returned failures during instance shutdown; this
+  adds the option ``--ignore-consistency`` to gnt-instance move
 
 And as usual, various improvements to the error messages, documentation
 and man pages.

-- 
iustin

Reply via email to