Commit 22d9752a authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

cluster-verify checks uniformity of exclusive_storage flag



The value of the flag should be the same for nodes within the same group.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 8c3d6797
......@@ -3371,6 +3371,21 @@ class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors):
nimg.sbp[pnode] = []
nimg.sbp[pnode].append(instance)
 
es_flags = rpc.GetExclusiveStorageForNodeNames(self.cfg, self.my_node_names)
es_unset_nodes = []
# The value of exclusive_storage should be the same across the group
if compat.any(es_flags.values()):
es_unset_nodes = [n for (n, es) in es_flags.items()
if not es]
if es_unset_nodes:
self._Error(constants.CV_EGROUPMIXEDESFLAG, self.group_info.name,
"The exclusive_storage flag should be uniform in a group,"
" but these nodes have it unset: %s",
utils.CommaJoin(utils.NiceSort(es_unset_nodes)))
self.LogWarning("Some checks required by exclusive storage will be"
" performed also on nodes with the flag unset")
# At this point, we have the in-memory data structures complete,
# except for the runtime information, which we'll gather next
 
......
......@@ -1432,6 +1432,7 @@ VERIFY_OPTIONAL_CHECKS = compat.UniqueFrozenset([VERIFY_NPLUSONE_MEM])
# Cluster Verify error classes
CV_TCLUSTER = "cluster"
CV_TGROUP = "group"
CV_TNODE = "node"
CV_TINSTANCE = "instance"
......@@ -1450,6 +1451,9 @@ CV_ECLUSTERDANGLINGNODES = \
CV_ECLUSTERDANGLINGINST = \
(CV_TNODE, "ECLUSTERDANGLINGINST",
"Some instances have a non-existing primary node")
CV_EGROUPMIXEDESFLAG = \
(CV_TGROUP, "EGROUPMIXEDESFLAG",
"exclusive_storage flag is not uniform within the group")
CV_EINSTANCEBADNODE = \
(CV_TINSTANCE, "EINSTANCEBADNODE",
"Instance marked as running lives on an offline node")
......
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