Commit 54383918 authored by Hrvoje Ribicic's avatar Hrvoje Ribicic

Add non-cherry-pickable changes related to state "rb----"

Ganeti versions 2.11 and 2.12 have both had patches related to strange
Xen domU states which are still legitimate running states, but Ganeti
did not recognize them as such. The previous two cherry-picked patches
bring some of these changes, but the final patch needed (79cb7ece)
cannot be cherry-picked because of a conflict with the other two
patches. The changes were made on different branches, and merged
together at a later time.

This patch manually adds the change, merging together the descriptions
of why certain states are allowed, and putting all of this into the
function docstring.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 77e8d509
......@@ -168,17 +168,29 @@ def _GetInstanceList(fn, include_node, _timeout=5):
return _ParseInstanceList(lines, include_node)
# Determine whether an instance is running
#
# An instance is running if it is in the following Xen states:
# running, blocked, or paused.
#
# A state of nothing '------' means that the domain is runnable but it
# is not currently running. That means it is in the queue behind
# other domains waiting to be scheduled to run.
# http://old-list-archives.xenproject.org/xen-users/2007-06/msg00849.html
def _IsInstanceRunning(instance_info):
"""Determine whether an instance is running.
An instance is running if it is in the following Xen states:
running, blocked, or paused.
For some strange reason, Xen once printed 'rb----' which does not make any
sense because an instance cannot be both running and blocked. Fortunately,
for Ganeti 'running' or 'blocked' is the same as 'running'.
A state of nothing '------' means that the domain is runnable but it is not
currently running. That means it is in the queue behind other domains waiting
to be scheduled to run.
http://old-list-archives.xenproject.org/xen-users/2007-06/msg00849.html
@type instance_info: string
@param instance_info: Information about instance, as supplied by Xen.
@rtype: bool
@return: Whether an instance is running.
"""
return instance_info == "r-----" \
or instance_info == "rb----" \
or instance_info == "-b----" \
or instance_info == "--p---" \
or instance_info == "------"
......
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