Revision 919852da

b/lib/client/gnt_group.py
50 50
  SubmitOpCode(op, opts=opts)
51 51

  
52 52

  
53
def AssignNodes(opts, args):
54
  """Assign nodes to a group.
55

  
56
  @param opts: the command line options selected by the user
57
  @type args: list
58
  @param args: args[0]: group to assign nodes to; args[1:]: nodes to assign
59
  @rtype: int
60
  @return: the desired exit code
61

  
62
  """
63
  group_name = args[0]
64
  node_names = args[1:]
65

  
66
  op = opcodes.OpAssignGroupNodes(group_name=group_name, nodes=node_names,
67
                                  force=opts.force)
68
  SubmitOpCode(op, opts=opts)
69

  
70

  
53 71
def ListGroups(opts, args):
54 72
  """List node groups and their properties.
55 73

  
......
148 166
  "add": (
149 167
    AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT, ALLOC_POLICY_OPT, NODE_PARAMS_OPT],
150 168
    "<group_name>", "Add a new node group to the cluster"),
169
  "assign-nodes": (
170
    AssignNodes, ARGS_ONE_GROUP + ARGS_MANY_NODES, [DRY_RUN_OPT, FORCE_OPT],
171
    "<group_name> <node>...", "Assign nodes to a group"),
151 172
  "list": (
152 173
    ListGroups, ARGS_MANY_GROUPS,
153 174
    [NOHDR_OPT, SEP_OPT, FIELDS_OPT],
b/man/gnt-group.rst
29 29
| {*group*}
30 30

  
31 31
Creates a new group with the given name. The node group will be
32
initially empty.
32
initially empty; to add nodes to it, use ``gnt-group assign-nodes``.
33 33

  
34 34
The ``--node-parameters`` option allows you to set default node
35 35
parameters for nodes in the group. Please see **ganeti**(7) for more
......
52 52
    (this is the default). Note that prioritization among groups in this
53 53
    state will be deferred to the iallocator plugin that's being used.
54 54

  
55
ASSIGN-NODES
56
~~~~~~~~~~~~
57

  
58
| **assign-nodes**
59
| [--force]
60
| {*group*} {*node*...}
61

  
62
Assigns one or more nodes to the specified group, moving them from their
63
original group (or groups).
64

  
65
By default, this command will refuse to proceed if the move would split
66
between groups any instance that was not previously split (a split
67
instance is an instance with a mirrored disk template, e.g. DRBD, that
68
has the primary and secondary nodes in different node groups). You can
69
force the operation with ``--force``.
55 70

  
56 71
MODIFY
57 72
~~~~~~

Also available in: Unified diff