Revision 7e9c6a78

b/lib/cmdlib.py
6989 6989
      }
6990 6990

  
6991 6991
  def _CheckFaultyDisks(self, instance, node_name):
6992
    if _FindFaultyInstanceDisks(self.cfg, self.rpc, instance,
6993
                                node_name, True):
6994
      raise errors.OpPrereqError("Instance '%s' has faulty disks on"
6995
                                 " node '%s'" % (instance.name, node_name),
6996
                                 errors.ECODE_STATE)
6992
    """Ensure faulty disks abort the opcode or at least warn."""
6993
    try:
6994
      if _FindFaultyInstanceDisks(self.cfg, self.rpc, instance,
6995
                                  node_name, True):
6996
        raise errors.OpPrereqError("Instance '%s' has faulty disks on"
6997
                                   " node '%s'" % (instance.name, node_name),
6998
                                   errors.ECODE_STATE)
6999
    except errors.OpPrereqError, err:
7000
      if self.op.ignore_consistency:
7001
        self.proc.LogWarning(str(err.args[0]))
7002
      else:
7003
        raise
6997 7004

  
6998 7005
  def CheckPrereq(self):
6999 7006
    """Check prerequisites.
......
7009 7016

  
7010 7017
    # Check whether any instance on this node has faulty disks
7011 7018
    for inst in _GetNodeInstances(self.cfg, self.op.node_name):
7019
      if not inst.admin_up:
7020
        continue
7012 7021
      check_nodes = set(inst.all_nodes)
7013 7022
      check_nodes.discard(self.op.node_name)
7014 7023
      for inst_node_name in check_nodes:
b/lib/opcodes.py
390 390
    "node_name",
391 391
    "storage_type",
392 392
    "name",
393
    "ignore_consistency",
393 394
    ]
394 395

  
395 396

  
b/man/gnt-node.sgml
889 889
        <command>modify-storage</command>
890 890
        <arg><option>--allocatable=yes|no</option></arg>
891 891
        <sbr>
892
        <arg><replaceable>node</replaceable></arg>
893
        <arg><replaceable>storage-type</replaceable></arg>
894
        <arg><replaceable>volume-name</replaceable></arg>
892
        <arg choice="req"><replaceable>node</replaceable></arg>
893
        <arg choice="req"><replaceable>storage-type</replaceable></arg>
894
        <arg choice="req"><replaceable>volume-name</replaceable></arg>
895 895
      </cmdsynopsis>
896 896

  
897 897
      <para>
......
913 913

  
914 914
      <cmdsynopsis>
915 915
        <command>repair-storage</command>
916
        <arg><replaceable>node</replaceable></arg>
917
        <arg><replaceable>storage-type</replaceable></arg>
918
        <arg><replaceable>volume-name</replaceable></arg>
916
        <arg>--ignore-consistency</arg>
917
        <arg choice="req"><replaceable>node</replaceable></arg>
918
        <arg choice="req"><replaceable>storage-type</replaceable></arg>
919
        <arg choice="req"><replaceable>volume-name</replaceable></arg>
919 920
      </cmdsynopsis>
920 921

  
921 922
      <para>
......
936 937
      </caution>
937 938

  
938 939
      <para>
940
        The <option>--ignore-consistency</option> option will ignore
941
        any inconsistent disks (on the nodes paired with this
942
        one). Use of this option is most likely to lead to data-loss.
943
      </para>
944

  
945
      <para>
939 946
        Example:
940 947
        <screen>
941 948
# gnt-node repair-storage node5.example.com lvm-vg xenvg
b/scripts/gnt-node
597 597

  
598 598
  op = opcodes.OpRepairNodeStorage(node_name=node_name,
599 599
                                   storage_type=storage_type,
600
                                   name=volume_name)
600
                                   name=volume_name,
601
                                   ignore_consistency=opts.ignore_consistency)
601 602
  SubmitOpCode(op)
602 603

  
603 604

  
......
709 710
    [ArgNode(min=1, max=1),
710 711
     ArgChoice(min=1, max=1, choices=_REPAIRABLE_STORAGE_TYPES),
711 712
     ArgFile(min=1, max=1)],
712
    [],
713
    [IGNORE_CONSIST_OPT],
713 714
    "<node_name> <storage_type> <name>",
714 715
    "Repairs a storage volume on a node"),
715 716
  'list-tags': (

Also available in: Unified diff