summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/deploy_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'ironic/drivers/modules/deploy_utils.py')
-rw-r--r--ironic/drivers/modules/deploy_utils.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py
index 673e4c664..4e0f29685 100644
--- a/ironic/drivers/modules/deploy_utils.py
+++ b/ironic/drivers/modules/deploy_utils.py
@@ -1406,6 +1406,32 @@ def set_async_step_flags(node, reboot=None, skip_current_step=None,
node.save()
+def prepare_agent_boot(task):
+ """Prepare booting the agent on the node.
+
+ :param task: a TaskManager instance.
+ """
+ deploy_opts = build_agent_options(task.node)
+ task.driver.boot.prepare_ramdisk(task, deploy_opts)
+
+
+def reboot_to_finish_step(task):
+ """Reboot the node into IPA to finish a deploy/clean step.
+
+ :param task: a TaskManager instance.
+ :returns: states.CLEANWAIT if cleaning operation in progress
+ or states.DEPLOYWAIT if deploy operation in progress.
+ """
+ if manager_utils.is_fast_track(task):
+ LOG.debug('Forcing power off on node %s for a clean reboot into '
+ 'the agent image', task.node)
+ manager_utils.node_power_action(task, states.POWER_OFF)
+ prepare_agent_boot(task)
+
+ manager_utils.node_power_action(task, states.REBOOT)
+ return get_async_step_return_state(task.node)
+
+
def get_root_device_for_deploy(node):
"""Get a root device requested for deployment or None.