Revision 249069a1 scripts/gnt-instance

b/scripts/gnt-instance
435 435
  return 0
436 436

  
437 437

  
438
def AddMDDRBDComponent(opts, args):
439
  """Add a new component to a remote_raid1 disk.
440

  
441
  Args:
442
    opts - class with options as members
443
    args - list with a single element, the instance name
444

  
445
  """
446
  op = opcodes.OpAddMDDRBDComponent(instance_name=args[0],
447
                                    disk_name=opts.disk,
448
                                    remote_node=opts.node)
449
  SubmitOpCode(op)
450
  return 0
451

  
452

  
453
def RemoveMDDRBDComponent(opts, args):
454
  """Remove a component from a remote_raid1 disk.
455

  
456
  Args:
457
    opts - class with options as members
458
    args - list with a single element, the instance name
459

  
460
  """
461
  op = opcodes.OpRemoveMDDRBDComponent(instance_name=args[0],
462
                                       disk_name=opts.disk,
463
                                       disk_id=opts.port)
464
  SubmitOpCode(op)
465
  return 0
466

  
467

  
468 438
def ReplaceDisks(opts, args):
469 439
  """Replace the disks of an instance
470 440

  
......
792 762
  'add': (AddInstance, ARGS_ONE, add_opts,
793 763
          "[opts...] <name>",
794 764
          "Creates and adds a new instance to the cluster"),
795
  'add-mirror': (AddMDDRBDComponent, ARGS_ONE,
796
                [DEBUG_OPT, node_opt,
797
                 make_option("-b", "--disk", dest="disk", metavar="sdX",
798
                             help=("The name of the instance disk for which to"
799
                                   " add the mirror"))],
800
                "-n node -b disk <instance>",
801
                "Creates a new mirror for the instance"),
802 765
  'console': (ConnectToInstanceConsole, ARGS_ONE, [DEBUG_OPT],
803 766
              "<instance>",
804 767
              "Opens a console on the specified instance"),
......
833 796
                                " process (shutdown, disk removal, etc.)")),
834 797
              ],
835 798
             "[-f] <instance>", "Shuts down the instance and removes it"),
836
  'remove-mirror': (RemoveMDDRBDComponent, ARGS_ONE,
837
                   [DEBUG_OPT, node_opt,
838
                    make_option("-b", "--disk", dest="disk", metavar="sdX",
839
                                help=("The name of the instance disk"
840
                                      " for which to add the mirror")),
841
                    make_option("-p", "--port", dest="port", metavar="PORT",
842
                                help=("The port of the drbd device"
843
                                      " which to remove from the mirror"),
844
                                type="int"),
845
                    ],
846
                   "-b disk -p port <instance>",
847
                   "Removes a mirror from the instance"),
848 799
  'rename': (RenameInstance, ARGS_FIXED(2),
849 800
             [DEBUG_OPT,
850 801
              make_option("--no-ip-check", dest="ignore_ip",

Also available in: Unified diff