Revision 05d47e33

b/man/gnt-instance.sgml
1666 1666
          <arg choice="req"><replaceable>instance</replaceable></arg>
1667 1667
        </cmdsynopsis>
1668 1668

  
1669
        <cmdsynopsis>
1670
          <command>replace-disks</command>
1671
          <arg>--submit</arg>
1672
          <arg choice="req">--auto</arg>
1673
          <arg choice="req"><replaceable>instance</replaceable></arg>
1674
        </cmdsynopsis>
1675

  
1669 1676
        <para>
1670 1677
          This command is a generalized form for replacing disks. It
1671 1678
          is currently only valid for the mirrored (DRBD) disk
......
1697 1704
        </para>
1698 1705

  
1699 1706
        <para>
1707
          The fourth form (when using <option>--auto</option>) will
1708
          automatically determine which disks of an instance are faulty and
1709
          replace them within the same node. The <option>--auto</option>
1710
          option works only when an instance has only faulty disks on
1711
          either the primary or secondary node; it doesn't work when
1712
          both sides have faulty disks.
1713
        </para>
1714

  
1715
        <para>
1700 1716
          The <option>--submit</option> option is used to send the job to
1701 1717
          the master daemon but not wait for its completion. The job
1702 1718
          ID will be shown so that it can be examined via
b/scripts/gnt-instance
826 826
      disks = [int(i) for i in opts.disks.split(",")]
827 827
    except ValueError, err:
828 828
      raise errors.OpPrereqError("Invalid disk index passed: %s" % str(err))
829
  cnt = [opts.on_primary, opts.on_secondary,
829
  cnt = [opts.on_primary, opts.on_secondary, opts.auto,
830 830
         new_2ndary is not None, iallocator is not None].count(True)
831 831
  if cnt != 1:
832
    raise errors.OpPrereqError("One and only one of the -p, -s, -n and -i"
832
    raise errors.OpPrereqError("One and only one of the -p, -s, -a, -n and -i"
833 833
                               " options must be passed")
834 834
  elif opts.on_primary:
835 835
    mode = constants.REPLACE_DISK_PRI
836 836
  elif opts.on_secondary:
837 837
    mode = constants.REPLACE_DISK_SEC
838
  elif opts.auto:
839
    mode = constants.REPLACE_DISK_AUTO
840
    if disks:
841
      raise errors.OpPrereqError("Cannot specify disks when using automatic"
842
                                 " mode")
838 843
  elif new_2ndary is not None or iallocator is not None:
839 844
    # replace secondary
840 845
    mode = constants.REPLACE_DISK_CHG
......
1463 1468
                                 default=False, action="store_true",
1464 1469
                                 help=("Replace the disk(s) on the secondary"
1465 1470
                                       " node (only for the drbd template)")),
1471
                     make_option("-a", "--auto", dest="auto",
1472
                                 default=False, action="store_true",
1473
                                 help=("Automatically replace faulty disks"
1474
                                       " (only for the drbd template)")),
1466 1475
                     make_option("--disks", dest="disks", default=None,
1467 1476
                                 help="Comma-separated list of disks"
1468 1477
                                 " indices to replace (e.g. 0,2) (optional,"

Also available in: Unified diff