From 832261fd977c7f218c3f9be2810e3f95281b3915 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Tue, 9 Dec 2008 09:33:32 +0000 Subject: [PATCH] Warn for instances living on offline nodes The patch also changes the result to error for non-reachable secondary nodes (as for primary nodes). Reviewed-by: ultrotter --- lib/cmdlib.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 8c62c25..4f7c68e 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -986,6 +986,7 @@ class LUVerifyCluster(LogicalUnit): result = self._VerifyInstance(instance, inst_config, node_volume, node_instance, feedback_fn, n_offline) bad = bad or result + inst_nodes_offline = [] inst_config.MapLVsByNode(node_vol_should) @@ -999,6 +1000,9 @@ class LUVerifyCluster(LogicalUnit): " %s failed" % (instance, pnode)) bad = True + if pnode in n_offline: + inst_nodes_offline.append(pnode) + # If the instance is non-redundant we cannot survive losing its primary # node, so we are not N+1 compliant. On the other hand we have no disk # templates with more than one secondary so that situation is not well @@ -1022,6 +1026,15 @@ class LUVerifyCluster(LogicalUnit): elif snode not in n_offline: feedback_fn(" - ERROR: instance %s, connection to secondary node" " %s failed" % (instance, snode)) + bad = True + if snode in n_offline: + inst_nodes_offline.append(snode) + + if inst_nodes_offline: + # warn that the instance lives on offline nodes, and set bad=True + feedback_fn(" - ERROR: instance lives on offline node(s) %s" % + ", ".join(inst_nodes_offline)) + bad = True feedback_fn("* Verifying orphan volumes") result = self._VerifyOrphanVolumes(node_vol_should, node_volume, -- 1.7.10.4