diff options
author | Nisha Agarwal <agarwalnisha1980@gmail.com> | 2022-10-10 12:38:49 +0000 |
---|---|---|
committer | Dmitry Tantsur <dtantsur@protonmail.com> | 2023-03-16 15:04:39 +0000 |
commit | c5e004a73eb96820a0c46402e9474d211d6f09ca (patch) | |
tree | 4004b32af5200b7bb5d7d95842fb391e74dbe11e /ironic/drivers/modules | |
parent | 821ce8c319a46cb212a9997fd8e9b964be6657fd (diff) | |
download | ironic-c5e004a73eb96820a0c46402e9474d211d6f09ca.tar.gz |
Fixes Secureboot with Anaconda deploy
Fixes Secureboot with Anaconda deploy with PXE and iPXE
Story:2010356
Task: 46529
Change-Id: Id6262654bb5e41e02c7d90b9a9aaf395e7b6a088
Diffstat (limited to 'ironic/drivers/modules')
-rw-r--r-- | ironic/drivers/modules/pxe.py | 15 | ||||
-rw-r--r-- | ironic/drivers/modules/pxe_base.py | 7 |
2 files changed, 7 insertions, 15 deletions
diff --git a/ironic/drivers/modules/pxe.py b/ironic/drivers/modules/pxe.py index fe93acefd..a55f5b9fd 100644 --- a/ironic/drivers/modules/pxe.py +++ b/ironic/drivers/modules/pxe.py @@ -27,6 +27,7 @@ from ironic.conductor import utils as manager_utils from ironic.conf import CONF from ironic.drivers import base from ironic.drivers.modules import agent_base +from ironic.drivers.modules import boot_mode_utils from ironic.drivers.modules import deploy_utils from ironic.drivers.modules import pxe_base LOG = logging.getLogger(__name__) @@ -114,21 +115,11 @@ class PXEAnacondaDeploy(agent_base.AgentBaseMixin, agent_base.HeartbeatMixin, def reboot_to_instance(self, task): node = task.node try: - # anaconda deploy will install the bootloader and the node is ready - # to boot from disk. - - deploy_utils.try_set_boot_device(task, boot_devices.DISK) - except Exception as e: - msg = (_("Failed to change the boot device to %(boot_dev)s " - "when deploying node %(node)s. Error: %(error)s") % - {'boot_dev': boot_devices.DISK, 'node': node.uuid, - 'error': e}) - agent_base.log_and_raise_deployment_error(task, msg) - - try: task.process_event('resume') self.clean_up(task) manager_utils.node_power_action(task, states.POWER_OFF) + deploy_utils.try_set_boot_device(task, boot_devices.DISK) + boot_mode_utils.configure_secure_boot_if_needed(task) task.driver.network.remove_provisioning_network(task) task.driver.network.configure_tenant_networks(task) manager_utils.node_power_action(task, states.POWER_ON) diff --git a/ironic/drivers/modules/pxe_base.py b/ironic/drivers/modules/pxe_base.py index daa90ba8d..f3ac49890 100644 --- a/ironic/drivers/modules/pxe_base.py +++ b/ironic/drivers/modules/pxe_base.py @@ -231,11 +231,12 @@ class PXEBaseMixin(object): :returns: None """ boot_mode_utils.sync_boot_mode(task) - boot_mode_utils.configure_secure_boot_if_needed(task) - node = task.node - boot_option = deploy_utils.get_boot_option(node) boot_device = None + boot_option = deploy_utils.get_boot_option(node) + if boot_option != "kickstart": + boot_mode_utils.configure_secure_boot_if_needed(task) + instance_image_info = {} if boot_option == "ramdisk" or boot_option == "kickstart": instance_image_info = pxe_utils.get_instance_image_info( |