Commit 40167d65 authored by Adeodato Simo's avatar Adeodato Simo Committed by Guido Trotter
Browse files

Cluster verify: accept a --node-group option



This will trigger a ClusterVerifyGroup operation only on the specified
group, skipping other groups as well as cluster-wide verifications.
Signed-off-by: default avatarAdeodato Simo <dato@google.com>
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent adfa3b26
......@@ -456,12 +456,16 @@ def VerifyCluster(opts, args):
simulate = opts.simulate_errors
skip_checks = []
# Verify cluster config.
op = opcodes.OpClusterVerifyConfig(verbose=opts.verbose,
error_codes=opts.error_codes,
debug_simulate_errors=simulate)
if opts.nodegroup is None:
# Verify cluster config.
op = opcodes.OpClusterVerifyConfig(verbose=opts.verbose,
error_codes=opts.error_codes,
debug_simulate_errors=simulate)
success, all_groups = SubmitOpCode(op, opts=opts)
success, all_groups = SubmitOpCode(op, opts=opts)
else:
success = True
all_groups = [opts.nodegroup]
if opts.skip_nplusone_mem:
skip_checks.append(constants.VERIFY_NPLUSONE_MEM)
......@@ -1259,7 +1263,7 @@ commands = {
'verify': (
VerifyCluster, ARGS_NONE,
[VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT,
DRY_RUN_OPT, PRIORITY_OPT],
DRY_RUN_OPT, PRIORITY_OPT, NODEGROUP_OPT],
"", "Does a check on the cluster configuration"),
'verify-disks': (
VerifyDisks, ARGS_NONE, [PRIORITY_OPT],
......
......@@ -579,7 +579,7 @@ node will be listed as /nodes/*name*, and an instance as
VERIFY
~~~~~~
**verify** [--no-nplus1-mem]
**verify** [--no-nplus1-mem] [--node-group *nodegroup*]
Verify correctness of cluster configuration. This is safe with
respect to running instances, and incurs no downtime of the
......@@ -589,6 +589,11 @@ If the ``--no-nplus1-mem`` option is given, Ganeti won't check
whether if it loses a node it can restart all the instances on
their secondaries (and report an error otherwise).
With ``--node-group``, restrict the verification to those nodes and
instances that live in the named group. This will not verify global
settings, but will allow to perform verification of a group while other
operations are ongoing in other groups.
VERIFY-DISKS
~~~~~~~~~~~~
......
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