summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/agent.py
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2022-07-14 17:33:55 +0200
committerDmitry Tantsur <dtantsur@protonmail.com>2022-08-02 12:47:31 +0200
commitf0a1778766d2fbd13dfa7dcf4521004deddcab55 (patch)
tree0b44e395d9b7c930c7610d702c4738d03d233283 /ironic/drivers/modules/agent.py
parent41484988efaa99122bb92b2314f781a53bba6984 (diff)
downloadironic-f0a1778766d2fbd13dfa7dcf4521004deddcab55.tar.gz
Finally remove support for netboot and the boot_option capability
Instance network boot (not to be confused with ramdisk, iSCSI or anaconda deploy methods) is insecure, underused and difficult to maintain. This change removes a lot of related code from Ironic. The so called "netboot fallback" is still supported for legacy boot when boot device management is not available or is unreliable. Change-Id: Ia8510e4acac6dec0a1e4f5cb0e07008548a00c52
Diffstat (limited to 'ironic/drivers/modules/agent.py')
-rw-r--r--ironic/drivers/modules/agent.py36
1 files changed, 1 insertions, 35 deletions
diff --git a/ironic/drivers/modules/agent.py b/ironic/drivers/modules/agent.py
index c171f81b1..1c0f5465e 100644
--- a/ironic/drivers/modules/agent.py
+++ b/ironic/drivers/modules/agent.py
@@ -16,7 +16,6 @@ from urllib import parse as urlparse
from ironic_lib import metrics_utils
from oslo_log import log
-from oslo_utils import excutils
from oslo_utils import units
from ironic.common import exception
@@ -325,33 +324,7 @@ class CustomAgentDeploy(agent_base.AgentBaseMixin, agent_base.AgentDeployMixin,
if node.provision_state == states.DEPLOYING:
# Validate network interface to ensure that it supports boot
# options configured on the node.
- try:
- task.driver.network.validate(task)
- except exception.InvalidParameterValue:
- # For 'neutron' network interface validation will fail
- # if node is using 'netboot' boot option while provisioning
- # a whole disk image. Updating 'boot_option' in node's
- # 'instance_info' to 'local for backward compatibility.
- # TODO(stendulker): Fail here once the default boot
- # option is local.
- # NOTE(TheJulia): Fixing the default boot mode only
- # masks the failure as the lack of a user definition
- # can be perceived as both an invalid configuration and
- # reliance upon the default configuration. The reality
- # being that in most scenarios, users do not want network
- # booting, so the changed default should be valid.
- with excutils.save_and_reraise_exception(reraise=False) as ctx:
- instance_info = node.instance_info
- capabilities = utils.parse_instance_info_capabilities(node)
- if 'boot_option' not in capabilities:
- capabilities['boot_option'] = 'local'
- instance_info['capabilities'] = capabilities
- node.instance_info = instance_info
- node.save()
- # Re-validate the network interface
- task.driver.network.validate(task)
- else:
- ctx.reraise = True
+ task.driver.network.validate(task)
# Determine if this is a fast track sequence
fast_track_deploy = manager_utils.is_fast_track(task)
if fast_track_deploy:
@@ -597,13 +570,6 @@ class AgentDeploy(CustomAgentDeploy):
iwdi = task.node.driver_internal_info.get('is_whole_disk_image')
cpu_arch = task.node.properties.get('cpu_arch')
- # If `boot_option` is set to `netboot`, PXEBoot.prepare_instance()
- # would need root_uuid of the whole disk image to add it into the
- # pxe config to perform chain boot.
- # IPA would have returned us the 'root_uuid_or_disk_id' if image
- # being provisioned is a whole disk image. IPA would also provide us
- # 'efi_system_partition_uuid' if the image being provisioned is a
- # partition image.
# In case of local boot using partition image, we need both
# 'root_uuid_or_disk_id' and 'efi_system_partition_uuid' to configure
# bootloader for local boot.