From dec0d9da26c6929e9157ec700f1e6dc8ab5a6bed Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Tue, 30 Jun 2009 18:10:16 +0200 Subject: [PATCH] Cleanup config data when draining nodes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Currently, when draining nodes we reset their master candidate flag, but we don't instruct them to demote themselves. This leads to “ERROR: file '/var/lib/ganeti/config.data' should not exist on non master candidates (and the file is outdated)”. This patch simply adds a call to node_demote_from_mc in this case. Signed-off-by: Iustin Pop Reviewed-by: Michael Hanselmann --- lib/cmdlib.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index f556677..cb3bb31 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -2464,6 +2464,10 @@ class LUSetNodeParams(LogicalUnit): node.master_candidate = False changed_mc = True result.append(("master_candidate", "auto-demotion due to drain")) + rrc = self.rpc.call_node_demote_from_mc(node.name) + msg = rrc.RemoteFailMsg() + if msg: + self.LogWarning("Node failed to demote itself: %s" % msg) if node.offline: node.offline = False result.append(("offline", "clear offline status due to drain")) -- 1.7.10.4