| **add**
| [--node-parameters=*NDPARAMS*]
+| [--alloc-policy=*POLICY*]
| {*group*}
Creates a new group with the given name. The node group will be
-initially empty.
+initially empty; to add nodes to it, use ``gnt-group assign-nodes``.
The ``--node-parameters`` option allows you to set default node
parameters for nodes in the group. Please see **ganeti**(7) for more
information about supported key=value pairs.
+The ``--alloc-policy`` option allows you to set an allocation policy for
+the group at creation time. Possible values are:
+
+unallocable
+ nodes in the group should not be candidates for instance allocation,
+ and the operation (e.g., instance creation) should fail if only
+ groups in this state could be found to satisfy the requirements.
+
+last_resort
+ nodes in the group should not be used for instance allocations,
+ unless this would be the only way to have the operation succeed.
+
+preferred
+ nodes in the group can be used freely for allocation of instances
+ (this is the default). Note that prioritization among groups in this
+ state will be deferred to the iallocator plugin that's being used.
+
+ASSIGN-NODES
+~~~~~~~~~~~~
+
+| **assign-nodes**
+| [--force]
+| {*group*} {*node*...}
+
+Assigns one or more nodes to the specified group, moving them from their
+original group (or groups).
+
+By default, this command will refuse to proceed if the move would split
+between groups any instance that was not previously split (a split
+instance is an instance with a mirrored disk template, e.g. DRBD, that
+has the primary and secondary nodes in different node groups). You can
+force the operation with ``--force``.
+
MODIFY
~~~~~~
| **modify**
| [--node-parameters=*NDPARAMS*]
+| [--alloc-policy=*POLICY*]
| {*group*}
Modifies some parameters from the node group.
-The ``--node-parameters`` option is documented in the **add** command
-above.
+The ``--node-parameters`` and ``--alloc-policy`` optiosn are documented
+in the **add** command above.
REMOVE
~~~~~~
| **remove** {*group*}
-Deletes the indicated node group, which must be empty.
+Deletes the indicated node group, which must be empty. There must always be at
+least one group, so the last group cannot be removed.
LIST
~~~~
-| **list** [--no-headers] [--separator=*SEPARATOR*]
-| [-o *[+]FIELD,...*] [group...]
+| **list** [--no-headers] [--separator=*SEPARATOR*] [-v]
+| [-o *[+]FIELD,...*] [--filter] [group...]
Lists all existing node groups in the cluster.
used between the output fields. Both these options are to help
scripting.
+The ``-v`` option activates verbose mode, which changes the display of
+special field states (see **ganeti(7)**).
+
The ``-o`` option takes a comma-separated list of output fields.
If the value of the option starts with the character ``+``, the new
-fields will be added to the default list. This allows to quickly
+fields will be added to the default list. This allows one to quickly
see the default list plus a few other fields, instead of retyping
the entire list of fields.
The available fields and their meaning are:
-name
- the group name
+@QUERY_FIELDS_GROUP@
-uuid
- the group's UUID
+If exactly one argument is given and it appears to be a query filter
+(see **ganeti(7)**), the query result is filtered accordingly. For
+ambiguous cases (e.g. a single field name as a filter) the ``--filter``
+(``-F``) option forces the argument to be treated as a filter.
-node_cnt
- the number of nodes in the node group
+If no group names are given, then all groups are included. Otherwise,
+only the named groups will be listed.
-node_list
- the list of nodes that belong to this group
+LIST-FIELDS
+~~~~~~~~~~~
-pinst_cnt
- the number of primary instances in the group (i.e., the number of
- primary instances nodes in this group have)
+**list-fields** [field...]
-pinst_list
- the list of primary instances in the group
+List available fields for node groups.
-ctime
- the creation time of the group; note that this field contains spaces
- and as such it's harder to parse
+RENAME
+~~~~~~
- if this attribute is not present (e.g. when upgrading from older
- versions), then "N/A" will be shown instead
+| **rename** {*oldname*} {*newname*}
-mtime
- the last modification time of the group; note that this field
- contains spaces and as such it's harder to parse
+Renames a given group from *oldname* to *newname*.
-serial_no
- the so called 'serial number' of the group; this is a numeric field
- that is incremented each time the node is modified, and it can be
- used to detect modifications
-If no group names are given, then all groups are included. Otherwise,
-only the named groups will be listed.
+EVACUATE
+~~~~~~~~
-RENAME
-~~~~~~
+**evacuate** [--iallocator *NAME*] [--to *GROUP*...] {*group*}
-| **rename** {*oldname*} {*newname*}
+This command will move all instances out of the given node group.
+Instances are placed in a new group by an iallocator, either given on
+the command line or as a cluster default.
-Renames a given group from *oldname* to *newname*.
+If no specific destination groups are specified using ``--to``, all
+groups except the evacuated group are considered.
+
+Example::
+
+ # gnt-group evacuate -I hail --to rack4 rack1
+
+
+TAGS
+~~~~
+
+ADD-TAGS
+^^^^^^^^
+
+**add-tags** [--from *file*] {*groupname*} {*tag*...}
+
+Add tags to the given node group. If any of the tags contains invalid
+characters, the entire operation will abort.
+
+If the ``--from`` option is given, the list of tags will be extended
+with the contents of that file (each line becomes a tag). In this case,
+there is not need to pass tags on the command line (if you do, both
+sources will be used). A file name of ``-`` will be interpreted as
+stdin.
+
+LIST-TAGS
+^^^^^^^^^
+
+**list-tags** {*groupname*}
+
+List the tags of the given node group.
+
+REMOVE-TAGS
+^^^^^^^^^^^
+
+**remove-tags** [--from *file*] {*groupname*} {*tag*...}
+
+Remove tags from the given node group. If any of the tags are not
+existing on the node, the entire operation will abort.
+
+If the ``--from`` option is given, the list of tags to be removed will
+be extended with the contents of that file (each line becomes a tag). In
+this case, there is not need to pass tags on the command line (if you
+do, tags from both sources will be removed). A file name of ``-`` will
+be interpreted as stdin.
+
+.. vim: set textwidth=72 :
+.. Local Variables:
+.. mode: rst
+.. fill-column: 72
+.. End: