Commit 61413377 authored by Stephen Shirley's avatar Stephen Shirley Committed by Iustin Pop

Add --force-join option to gnt-node add

This is needed so cluster-merge can add nodes from other clusters.
Signed-off-by: default avatarStephen Shirley <diamond@google.com>
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 6323e232
......@@ -104,6 +104,7 @@ __all__ = [
"NEW_RAPI_CERT_OPT",
"NEW_SECONDARY_OPT",
"NIC_PARAMS_OPT",
"NODE_FORCE_JOIN_OPT",
"NODE_LIST_OPT",
"NODE_PLACEMENT_OPT",
"NODEGROUP_OPT",
......@@ -885,6 +886,11 @@ NOSSH_KEYCHECK_OPT = cli_option("--no-ssh-key-check", dest="ssh_key_check",
default=True, action="store_false",
help="Disable SSH key fingerprint checking")
NODE_FORCE_JOIN_OPT = cli_option("--force-join", dest="force_join",
default=False, action="store_true",
help="Force the joining of a node,"
" needed when merging clusters")
MC_OPT = cli_option("-C", "--master-candidate", dest="master_candidate",
type="bool", default=None, metavar=_YORNO,
help="Set the master_candidate flag on the node")
......
......@@ -134,6 +134,8 @@ def _RunSetupSSH(options, nodes):
cmd.append("--verbose")
if not options.ssh_key_check:
cmd.append("--no-ssh-key-check")
if options.force_join:
cmd.append("--force-join")
cmd.extend(nodes)
......@@ -715,10 +717,11 @@ def SetNodeParams(opts, args):
commands = {
'add': (
AddNode, [ArgHost(min=1, max=1)],
[SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT, NONODE_SETUP_OPT,
VERBOSE_OPT, NODEGROUP_OPT, PRIORITY_OPT, CAPAB_MASTER_OPT,
CAPAB_VM_OPT, NODE_PARAMS_OPT],
"[-s ip] [--readd] [--no-ssh-key-check] [--no-node-setup] [--verbose] "
[SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT, NODE_FORCE_JOIN_OPT,
NONODE_SETUP_OPT, VERBOSE_OPT, NODEGROUP_OPT, PRIORITY_OPT,
CAPAB_MASTER_OPT, CAPAB_VM_OPT, NODE_PARAMS_OPT],
"[-s ip] [--readd] [--no-ssh-key-check] [--force-join]"
" [--no-node-setup] [--verbose]"
" <node_name>",
"Add a node to the cluster"),
'evacuate': (
......
......@@ -49,6 +49,10 @@ secondary IP again, it will reused from the cluster. Also, the
drained and offline flags of the node will be cleared before
re-adding it.
The ``--force-join`` option is to proceed with adding a node even if it already
appears to belong to another cluster. This is used during cluster merging, for
example.
The ``-g`` is used to add the new node into a specific node group,
specified by UUID or name. If only one node group exists you can
skip this option, otherwise it's mandatory.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment