Node Creation with Known MAC address(es)#
When a new node's MAC address is known, the simplest method to add the node to
the cluster is to use the cw-nodectl create command and supply that node's
MAC address:
cw-nodectl create mac=11:22:33:44:55:66
The node is assigned the next available node index and associated IP address.
You can also add the node at an index other than the next available index. For example, to add a node n10:
cw-nodectl create mac=11:22:33:44:55:66 index=10
Node attributes, including reserved attributes, can also be set when the node is created. For example, to add a node with a different boot style:
cw-nodectl create mac=11:22:33:44:55:66 attributes._boot_style=roram
If a node already exists for the specified MAC or index, then an error is returned and no node is created.
Create Multiple Nodes#
Adding nodes one at a time is tedious for a large cluster. Instead, you can
provide JSON-formatted content to the create action and create multiple
nodes with a single command.
Create a JSON file that contains an array of JSON objects where each object describes a single node. For example, for two nodes:
[ { "mac": "11:22:33:44:55:66" }, { "mac": "00:11:22:33:44:55" } ]Include a path to the JSON file when creating the nodes:
cw-nodectl create --content @path/to/file.json
The content argument can also directly accept JSON, or an INI formatted
file, or a specially formatted text file. Details of how to use these
alternative formats are available in The --content argument.