"""
(group_name,) = args
- op = opcodes.OpAddGroup(group_name=group_name)
+ op = opcodes.OpAddGroup(group_name=group_name, ndparams=opts.ndparams)
SubmitOpCode(op, opts=opts)
commands = {
"add": (
- AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT],
+ AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT, NODE_PARAMS_OPT],
"<group_name>", "Add a new node group to the cluster"),
"list": (
ListGroups, ARGS_MANY_GROUPS,
_OP_PARAMS = [
_PGroupName,
+ ("ndparams", None, ht.TOr(ht.TDict, ht.TNone)),
]
REQ_BGL = False
(self.op.group_name, existing_uuid),
errors.ECODE_EXISTS)
+ if self.op.ndparams:
+ utils.ForceDictType(self.op.ndparams, constants.NDS_PARAMETER_TYPES)
+
def BuildHooksEnv(self):
"""Build hooks env.
"""
group_obj = objects.NodeGroup(name=self.op.group_name, members=[],
- uuid=self.group_uuid)
+ uuid=self.group_uuid,
+ ndparams=self.op.ndparams)
self.cfg.AddNodeGroup(group_obj, self.proc.GetECId(), check_uuid=False)
del self.remove_locks[locking.LEVEL_NODEGROUP]
"""Add a node group to the cluster."""
OP_ID = "OP_GROUP_ADD"
OP_DSC_FIELD = "group_name"
- __slots__ = ["group_name"]
+ __slots__ = [
+ "group_name",
+ "ndparams",
+ ]
class OpQueryGroups(OpCode):
ADD
~~~
-| **add** {*group*}
+| **add**
+| [--node-parameters=*NDPARAMS*]
+| {*group*}
Creates a new group with the given name. The node group will be
initially empty.
+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.
+
REMOVE
~~~~~~