Revision 085e0d9f
b/lib/client/gnt_node.py | ||
---|---|---|
216 | 216 |
|
217 | 217 |
bootstrap.SetupNodeDaemon(cluster_name, node, opts.ssh_key_check) |
218 | 218 |
|
219 |
if opts.disk_state: |
|
220 |
disk_state = utils.FlatToDict(opts.disk_state) |
|
221 |
else: |
|
222 |
disk_state = {} |
|
223 |
|
|
224 |
hv_state = dict(opts.hv_state) |
|
225 |
|
|
219 | 226 |
op = opcodes.OpNodeAdd(node_name=args[0], secondary_ip=sip, |
220 | 227 |
readd=opts.readd, group=opts.nodegroup, |
221 | 228 |
vm_capable=opts.vm_capable, ndparams=opts.ndparams, |
222 |
master_capable=opts.master_capable) |
|
229 |
master_capable=opts.master_capable, |
|
230 |
disk_state=disk_state, |
|
231 |
hv_state=hv_state) |
|
223 | 232 |
SubmitOpCode(op, opts=opts) |
224 | 233 |
|
225 | 234 |
|
... | ... | |
868 | 877 |
AddNode, [ArgHost(min=1, max=1)], |
869 | 878 |
[SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT, NODE_FORCE_JOIN_OPT, |
870 | 879 |
NONODE_SETUP_OPT, VERBOSE_OPT, NODEGROUP_OPT, PRIORITY_OPT, |
871 |
CAPAB_MASTER_OPT, CAPAB_VM_OPT, NODE_PARAMS_OPT], |
|
880 |
CAPAB_MASTER_OPT, CAPAB_VM_OPT, NODE_PARAMS_OPT, HV_STATE_OPT, |
|
881 |
DISK_STATE_OPT], |
|
872 | 882 |
"[-s ip] [--readd] [--no-ssh-key-check] [--force-join]" |
873 | 883 |
" [--no-node-setup] [--verbose]" |
874 | 884 |
" <node_name>", |
b/lib/cmdlib.py | ||
---|---|---|
5377 | 5377 |
if self.op.ndparams: |
5378 | 5378 |
utils.ForceDictType(self.op.ndparams, constants.NDS_PARAMETER_TYPES) |
5379 | 5379 |
|
5380 |
if self.op.hv_state: |
|
5381 |
self.new_hv_state = _MergeAndVerifyHvState(self.op.hv_state, None) |
|
5382 |
|
|
5383 |
if self.op.disk_state: |
|
5384 |
self.new_disk_state = _MergeAndVerifyDiskState(self.op.disk_state, None) |
|
5385 |
|
|
5380 | 5386 |
def Exec(self, feedback_fn): |
5381 | 5387 |
"""Adds the new node to the cluster. |
5382 | 5388 |
|
... | ... | |
5415 | 5421 |
else: |
5416 | 5422 |
new_node.ndparams = {} |
5417 | 5423 |
|
5424 |
if self.op.hv_state: |
|
5425 |
new_node.hv_state_static = self.new_hv_state |
|
5426 |
|
|
5427 |
if self.op.disk_state: |
|
5428 |
new_node.disk_state_static = self.new_disk_state |
|
5429 |
|
|
5418 | 5430 |
# check connectivity |
5419 | 5431 |
result = self.rpc.call_version([node])[node] |
5420 | 5432 |
result.Raise("Can't get version information from node %s" % node) |
b/lib/opcodes.py | ||
---|---|---|
932 | 932 |
OP_DSC_FIELD = "node_name" |
933 | 933 |
OP_PARAMS = [ |
934 | 934 |
_PNodeName, |
935 |
_PHvState, |
|
936 |
_PDiskState, |
|
935 | 937 |
("primary_ip", None, ht.NoType, "Primary IP address"), |
936 | 938 |
("secondary_ip", None, ht.TMaybeString, "Secondary IP address"), |
937 | 939 |
("readd", False, ht.TBool, "Whether node is re-added to cluster"), |
b/man/gnt-node.rst | ||
---|---|---|
27 | 27 |
| [{-g|--node-group} *nodegroup*] |
28 | 28 |
| [--master-capable=``yes|no``] [--vm-capable=``yes|no``] |
29 | 29 |
| [--node-parameters *ndparams*] |
30 |
| [--disk-state *diskstate*] |
|
31 |
| [--hypervisor-state *hvstate*] |
|
30 | 32 |
| {*nodename*} |
31 | 33 |
|
32 | 34 |
Adds the given node to the cluster. |
... | ... | |
58 | 60 |
specific node group, specified by UUID or name. If only one node group |
59 | 61 |
exists you can skip this option, otherwise it's mandatory. |
60 | 62 |
|
61 |
The ``vm_capable``, ``master_capable`` and ``ndparams`` options are
|
|
62 |
described in **ganeti**(7), and are used to set the properties of the
|
|
63 |
new node. |
|
63 |
The ``vm_capable``, ``master_capable``, ``ndparams``, ``diskstate`` and
|
|
64 |
``hvstate`` options are described in **ganeti**(7), and are used to set
|
|
65 |
the properties of the new node.
|
|
64 | 66 |
|
65 | 67 |
Example:: |
66 | 68 |
|
Also available in: Unified diff