Commit dec0d9da authored by Iustin Pop's avatar Iustin Pop
Browse files

Cleanup config data when draining nodes

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/' 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: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent a8ae3eb5
...@@ -2464,6 +2464,10 @@ class LUSetNodeParams(LogicalUnit): ...@@ -2464,6 +2464,10 @@ class LUSetNodeParams(LogicalUnit):
node.master_candidate = False node.master_candidate = False
changed_mc = True changed_mc = True
result.append(("master_candidate", "auto-demotion due to drain")) result.append(("master_candidate", "auto-demotion due to drain"))
rrc = self.rpc.call_node_demote_from_mc(
msg = rrc.RemoteFailMsg()
if msg:
self.LogWarning("Node failed to demote itself: %s" % msg)
if node.offline: if node.offline:
node.offline = False node.offline = False
result.append(("offline", "clear offline status due to drain")) result.append(("offline", "clear offline status due to drain"))
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