diff --git a/lib/cmdlib.py b/lib/cmdlib.py index ca0650a15e4097e3df49274230af6eedae6be17e..c0062c9c4d6a058ae92f4221ae052010eede21dc 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -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 diff --git a/lib/constants.py b/lib/constants.py index 9203bf3de6818e4e0094e04ab803c5504f17035f..e0b5daeb333e32210eaa08592ce7477d1269cc18 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -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")