Commit 44b5876a authored by Jose A. Lopes's avatar Jose A. Lopes

Consider 'Cluster.enabled_user_shutdown' in instance queries

If 'enabled_user_shutdown' is 'False', instances should not be
reported as 'USER_down'.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent b996ad2f
......@@ -231,8 +231,9 @@ class LUInstanceQueryData(NoHooksLU):
remote_info = remote_info.payload
allow_userdown = \
instance.hypervisor != constants.HT_KVM or \
hvparams[constants.HV_KVM_USER_SHUTDOWN]
cluster.enabled_user_shutdown and \
(instance.hypervisor != constants.HT_KVM or
hvparams[constants.HV_KVM_USER_SHUTDOWN])
if remote_info and "state" in remote_info:
if hv_base.HvInstanceState.IsShutdown(remote_info["state"]):
......
......@@ -1528,8 +1528,9 @@ def _GetLiveInstStatus(ctx, instance, instance_state):
hvparams = ctx.cluster.FillHV(instance, skip_globals=True)
allow_userdown = \
instance.hypervisor != constants.HT_KVM or \
hvparams[constants.HV_KVM_USER_SHUTDOWN]
ctx.cluster.enabled_user_shutdown and \
(instance.hypervisor != constants.HT_KVM or
hvparams[constants.HV_KVM_USER_SHUTDOWN])
if instance.uuid in ctx.wrongnode_inst:
return constants.INSTST_WRONGNODE
......
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