Commit 1b9690aa authored by Guido Trotter's avatar Guido Trotter
Browse files

Handle offline nodes for "instance down" checks

When offlining an instance because its primary node is down, we must be
able to cope with the situation.
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarIustin Pop <>
parent a47dc554
......@@ -1108,13 +1108,16 @@ def _CheckInstanceState(lu, instance, req_states, msg=None):
if constants.ADMINST_UP not in req_states:
pnode = instance.primary_node
if not lu.cfg.GetNodeInfo(pnode).offline:
ins_l = lu.rpc.call_instance_list([pnode], [instance.hypervisor])[pnode]
ins_l.Raise("Can't contact node %s for instance information" % pnode,
prereq=True, ecode=errors.ECODE_ENVIRON)
if in ins_l.payload:
raise errors.OpPrereqError("Instance %s is running, %s" %
(, msg), errors.ECODE_STATE)
lu.LogWarning("Primary node offline, ignoring check that instance"
" is down")
def _ComputeMinMaxSpec(name, qualifier, ipolicy, value):
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