summaryrefslogtreecommitdiff
path: root/ironic/conductor/manager.py
diff options
context:
space:
mode:
authorArun S A G <sagarun@gmail.com>2021-03-01 00:09:34 -0800
committerJay Faulkner <jay.faulkner@verizonmedia.com>2021-03-31 14:20:39 -0700
commit288b8fd88351afcb4cd254a208dc75e18cb20cb9 (patch)
tree8178d6b1eabefefbc88e25e87c8bedc0b81256c9 /ironic/conductor/manager.py
parent34b2183862fe6efdcd08ff9a56c49dd4a9ae4d40 (diff)
downloadironic-288b8fd88351afcb4cd254a208dc75e18cb20cb9.tar.gz
Add agent_status and agent_status_message params to heartbeat
agent_status is used by anaconda ramdisk to inform the conductor about state of the deployment. Valid agent states are 'start', 'end' and 'error'. The agent_status_message is used to describe the why the agent_status is set to a particular state. Use of these parameters require API version 1.72 or greater. When anaconda finishes deployment the agent_status is set to 'end'. When anaconda ramdisk is unable to deploy the OS for some reason the agent_status is set to 'error'. PXEAnacondaDeploy is implemented to handle the 'anaconda' deploy interface. PXEAnacondaDeploy ties to together pieces needed to deploy a node using anaconda ramdisk. Co-Authored-By: Jay Faulkner <jay@jvf.cc> Change-Id: Ieb452149730510b001c4712bbb2e0f28acfc3c2e
Diffstat (limited to 'ironic/conductor/manager.py')
-rw-r--r--ironic/conductor/manager.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/ironic/conductor/manager.py b/ironic/conductor/manager.py
index aafdd41de..c26b10930 100644
--- a/ironic/conductor/manager.py
+++ b/ironic/conductor/manager.py
@@ -91,7 +91,7 @@ class ConductorManager(base_manager.BaseConductorManager):
# NOTE(rloo): This must be in sync with rpcapi.ConductorAPI's.
# NOTE(pas-ha): This also must be in sync with
# ironic.common.release_mappings.RELEASE_MAPPING['master']
- RPC_API_VERSION = '1.53'
+ RPC_API_VERSION = '1.54'
target = messaging.Target(version=RPC_API_VERSION)
@@ -3034,7 +3034,8 @@ class ConductorManager(base_manager.BaseConductorManager):
@messaging.expected_exceptions(exception.InvalidParameterValue)
@messaging.expected_exceptions(exception.NoFreeConductorWorker)
def heartbeat(self, context, node_id, callback_url, agent_version=None,
- agent_token=None, agent_verify_ca=None):
+ agent_token=None, agent_verify_ca=None, agent_status=None,
+ agent_status_message=None):
"""Process a heartbeat from the ramdisk.
:param context: request context.
@@ -3048,13 +3049,18 @@ class ConductorManager(base_manager.BaseConductorManager):
agent_version, in these cases assume agent v3.0.0 (the last release
before sending agent_version was introduced).
:param agent_token: randomly generated validation token.
+ :param agent_status: Status of the heartbeating agent. Agent status is
+ one of 'start', 'end', error'
+ :param agent_status_message: Message describing agent's status
:param agent_verify_ca: TLS certificate for the agent.
:raises: NoFreeConductorWorker if there are no conductors to process
this heartbeat request.
"""
LOG.debug('RPC heartbeat called for node %s', node_id)
- if agent_version is None:
+ # Do not raise exception if version is missing when agent is
+ # anaconda ramdisk.
+ if agent_version is None and agent_status is None:
LOG.error('Node %s transmitted no version information which '
'indicates the agent is incompatible with the ironic '
'services and must be upgraded.', node_id)
@@ -3091,7 +3097,8 @@ class ConductorManager(base_manager.BaseConductorManager):
task.spawn_after(
self._spawn_worker, task.driver.deploy.heartbeat,
- task, callback_url, agent_version, agent_verify_ca)
+ task, callback_url, agent_version, agent_verify_ca,
+ agent_status, agent_status_message)
@METRICS.timer('ConductorManager.vif_list')
@messaging.expected_exceptions(exception.NetworkError,