diff options
author | Dmitry Tantsur <dtantsur@protonmail.com> | 2020-07-03 11:22:10 +0200 |
---|---|---|
committer | Dmitry Tantsur <dtantsur@protonmail.com> | 2020-07-03 11:22:10 +0200 |
commit | 1a02c79ed135291814695462bad633d6464af266 (patch) | |
tree | 1becca829cdb49fabfbf5bcd0f70a5db6df472c7 | |
parent | 5026854e318fc8d324c18896e51e666b1064b1d4 (diff) | |
download | ironic-1a02c79ed135291814695462bad633d6464af266.tar.gz |
Log when a node should be fast-track-able but it's not
Change-Id: I27fee44d8c89ed5dff310822af2a103e5e6e682c
-rw-r--r-- | ironic/conductor/utils.py | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/ironic/conductor/utils.py b/ironic/conductor/utils.py index 4b994db86..fac2f7f3e 100644 --- a/ironic/conductor/utils.py +++ b/ironic/conductor/utils.py @@ -972,11 +972,25 @@ def is_fast_track(task): :returns: True if the last heartbeat that was recorded was within the [deploy]fast_track_timeout setting. """ - return (fast_track_able(task) - and value_within_timeout( - task.node.driver_internal_info.get('agent_last_heartbeat'), - CONF.deploy.fast_track_timeout) - and task.driver.power.get_power_state(task) == states.POWER_ON) + if (not fast_track_able(task) + or task.driver.power.get_power_state(task) != states.POWER_ON): + if task.node.last_error: + LOG.debug('Node %(node)s is not fast-track-able because it has ' + 'an error: %(error)s', + {'node': task.node.uuid, 'error': task.node.last_error}) + return False + + if value_within_timeout( + task.node.driver_internal_info.get('agent_last_heartbeat'), + CONF.deploy.fast_track_timeout): + return True + else: + LOG.debug('Node %(node)s should be fast-track-able, but the agent ' + 'doesn\'t seem to be running. Last heartbeat: %(last)s', + {'node': task.node.uuid, + 'last': task.node.driver_internal_info.get( + 'agent_last_heartbeat')}) + return False def remove_agent_url(node): |