Skip to content
Snippets Groups Projects
Commit e32e1fb9 authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

Verify that templates are compatible with exclusive storage


cluster-verify reports instances with disk templates not compatible with
exclusive storage but that are running on nodes with the exclusive storage
flag set.

Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent d5a690cb
No related merge requests found
......@@ -2688,6 +2688,18 @@ class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors):
utils.CommaJoin(inst_config.secondary_nodes),
code=self.ETYPE_WARNING)
 
if inst_config.disk_template not in constants.DTS_EXCL_STORAGE:
# Disk template not compatible with exclusive_storage: no instance
# node should have the flag set
es_flags = rpc.GetExclusiveStorageForNodeNames(self.cfg,
inst_config.all_nodes)
es_nodes = [n for (n, es) in es_flags.items()
if es]
_ErrorIf(es_nodes, constants.CV_EINSTANCEUNSUITABLENODE, instance,
"instance has template %s, which is not supported on nodes"
" that have exclusive storage set: %s",
inst_config.disk_template, utils.CommaJoin(es_nodes))
if inst_config.disk_template in constants.DTS_INT_MIRROR:
instance_nodes = utils.NiceSort(inst_config.all_nodes)
instance_groups = {}
......
......@@ -1476,6 +1476,9 @@ CV_EINSTANCESPLITGROUPS = \
CV_EINSTANCEPOLICY = \
(CV_TINSTANCE, "EINSTANCEPOLICY",
"Instance does not meet policy")
CV_EINSTANCEUNSUITABLENODE = \
(CV_TINSTANCE, "EINSTANCEUNSUITABLENODE",
"Instance running on nodes that are not suitable for it")
CV_ENODEDRBD = \
(CV_TNODE, "ENODEDRBD", "Error parsing the DRBD status file")
CV_ENODEDRBDHELPER = \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment