summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules
diff options
context:
space:
mode:
Diffstat (limited to 'ironic/drivers/modules')
-rw-r--r--ironic/drivers/modules/agent.py36
-rw-r--r--ironic/drivers/modules/agent_base.py12
-rw-r--r--ironic/drivers/modules/agent_config.template13
-rw-r--r--ironic/drivers/modules/ansible/deploy.py6
-rw-r--r--ironic/drivers/modules/deploy_utils.py12
-rw-r--r--ironic/drivers/modules/ilo/boot.py27
-rw-r--r--ironic/drivers/modules/ilo/power.py5
-rw-r--r--ironic/drivers/modules/ipxe_config.template6
-rw-r--r--ironic/drivers/modules/irmc/boot.py5
-rw-r--r--ironic/drivers/modules/network/neutron.py11
-rw-r--r--ironic/drivers/modules/pxe_base.py44
-rw-r--r--ironic/drivers/modules/pxe_config.template6
-rw-r--r--ironic/drivers/modules/pxe_grub_config.template5
13 files changed, 21 insertions, 167 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.
diff --git a/ironic/drivers/modules/agent_base.py b/ironic/drivers/modules/agent_base.py
index 582c36d90..ff2a454ea 100644
--- a/ironic/drivers/modules/agent_base.py
+++ b/ironic/drivers/modules/agent_base.py
@@ -1217,12 +1217,12 @@ class AgentDeployMixin(HeartbeatMixin, AgentOobStepsMixin):
"""
node = task.node
- if deploy_utils.get_boot_option(node) == "local":
- # Install the boot loader
- self.configure_local_boot(
- task, root_uuid=root_uuid,
- efi_system_part_uuid=efi_sys_uuid,
- prep_boot_part_uuid=prep_boot_part_uuid)
+ # Install the boot loader
+ self.configure_local_boot(
+ task, root_uuid=root_uuid,
+ efi_system_part_uuid=efi_sys_uuid,
+ prep_boot_part_uuid=prep_boot_part_uuid)
+
try:
task.driver.boot.prepare_instance(task)
except Exception as e:
diff --git a/ironic/drivers/modules/agent_config.template b/ironic/drivers/modules/agent_config.template
deleted file mode 100644
index bf9f5f4b4..000000000
--- a/ironic/drivers/modules/agent_config.template
+++ /dev/null
@@ -1,13 +0,0 @@
-default deploy
-
-label deploy
-kernel {{ pxe_options.deployment_aki_path }}
-append initrd={{ pxe_options.deployment_ari_path }} text {{ pxe_options.pxe_append_params }}
-
-label boot_partition
-kernel {{ pxe_options.aki_path }}
-append initrd={{ pxe_options.ari_path }} root={{ ROOT }} ro text {{ pxe_options.pxe_append_params|default("", true) }}
-
-label boot_whole_disk
-COM32 chain.c32
-append mbr:{{ DISK_IDENTIFIER }}
diff --git a/ironic/drivers/modules/ansible/deploy.py b/ironic/drivers/modules/ansible/deploy.py
index cd3f4c68f..d7cf49412 100644
--- a/ironic/drivers/modules/ansible/deploy.py
+++ b/ironic/drivers/modules/ansible/deploy.py
@@ -396,12 +396,6 @@ class AnsibleDeploy(agent_base.HeartbeatMixin,
task.driver.boot.validate(task)
node = task.node
- iwdi = node.driver_internal_info.get('is_whole_disk_image')
- if not iwdi and deploy_utils.get_boot_option(node) == "netboot":
- raise exception.InvalidParameterValue(_(
- "Node %(node)s is configured to use the ansible deploy "
- "interface, which does not support netboot.") %
- {'node': node.uuid})
params = {}
image_source = node.instance_info.get('image_source')
diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py
index bcefd2323..399dfa68f 100644
--- a/ironic/drivers/modules/deploy_utils.py
+++ b/ironic/drivers/modules/deploy_utils.py
@@ -55,7 +55,6 @@ LOG = logging.getLogger(__name__)
METRICS = metrics_utils.get_metrics_logger(__name__)
SUPPORTED_CAPABILITIES = {
- 'boot_option': ('local', 'netboot', 'ramdisk', 'kickstart'),
'boot_mode': ('bios', 'uefi'),
'secure_boot': ('true', 'false'),
'disk_label': ('msdos', 'gpt'),
@@ -159,6 +158,9 @@ def _replace_disk_identifier(path, disk_identifier):
# NOTE(TheJulia): This should likely be migrated to pxe_utils.
+# TODO(dtantsur): with the removal of netboot, root_uuid_or_disk_id and
+# the logic of replacing ROOT can be dropped, while is_whole_disk_image can
+# be renamed to something like netboot_fallback.
def switch_pxe_config(path, root_uuid_or_disk_id, boot_mode,
is_whole_disk_image, iscsi_boot=False,
ramdisk_boot=False, ipxe_enabled=False,
@@ -616,17 +618,11 @@ def get_boot_option(node):
:returns: A string representing the boot option type. Defaults to
configuration setting [deploy]default_boot_mode.
"""
-
- # NOTE(TheJulia): Software raid always implies local deployment
- if is_software_raid(node):
- return 'local'
if is_anaconda_deploy(node):
return 'kickstart'
if is_ramdisk_deploy(node):
return 'ramdisk'
- capabilities = utils.parse_instance_info_capabilities(node)
- return capabilities.get('boot_option',
- CONF.deploy.default_boot_option).lower()
+ return 'local'
# FIXME(dtantsur): relying on deploy interface name is an anti-pattern.
diff --git a/ironic/drivers/modules/ilo/boot.py b/ironic/drivers/modules/ilo/boot.py
index 7f5c5adcf..e29852981 100644
--- a/ironic/drivers/modules/ilo/boot.py
+++ b/ironic/drivers/modules/ilo/boot.py
@@ -320,7 +320,7 @@ class IloVirtualMediaBoot(base.BootInterface):
except exception.ImageRefValidationFailed:
with excutils.save_and_reraise_exception():
LOG.error("Virtual media deploy with 'ramdisk' "
- "boot_option accepts only Glance images or "
+ "deploy accepts only Glance images or "
"HTTP(S) URLs as "
"instance_info['boot_iso']. Either %s "
"is not a valid HTTP(S) URL or is not "
@@ -460,21 +460,8 @@ class IloVirtualMediaBoot(base.BootInterface):
boot_devices.CDROM,
persistent=True)
else:
- # Boot from disk every time if the image deployed is
- # a whole disk image.
- node = task.node
- iwdi = node.driver_internal_info.get('is_whole_disk_image')
- if deploy_utils.get_boot_option(node) == "local" or iwdi:
- manager_utils.node_set_boot_device(task, boot_devices.DISK,
- persistent=True)
- else:
- drv_int_info = node.driver_internal_info
- root_uuid_or_disk_id = drv_int_info.get('root_uuid_or_disk_id')
- if root_uuid_or_disk_id:
- self._configure_vmedia_boot(task, root_uuid_or_disk_id)
- else:
- LOG.warning("The UUID for the root partition could not "
- "be found for node %s", node.uuid)
+ manager_utils.node_set_boot_device(task, boot_devices.DISK,
+ persistent=True)
# Set boot mode
ilo_common.update_boot_mode(task)
# Need to enable secure boot, if being requested
@@ -590,8 +577,7 @@ class IloPXEBoot(pxe.PXEBoot):
"""Prepares the boot of instance.
This method prepares the boot of the instance after reading
- relevant information from the node's instance_info. In case of netboot,
- it updates the dhcp entries and switches the PXE config. In case of
+ relevant information from the node's instance_info. In case of
localboot, it cleans up the PXE config.
In case of 'boot from volume', it updates the iSCSI info onto iLO and
sets the node to boot from 'UefiTarget' boot device.
@@ -683,8 +669,7 @@ class IloiPXEBoot(ipxe.iPXEBoot):
"""Prepares the boot of instance.
This method prepares the boot of the instance after reading
- relevant information from the node's instance_info. In case of netboot,
- it updates the dhcp entries and switches the PXE config. In case of
+ relevant information from the node's instance_info. In case of
localboot, it cleans up the PXE config.
In case of 'boot from volume', it updates the iSCSI info onto iLO and
sets the node to boot from 'UefiTarget' boot device.
@@ -904,7 +889,7 @@ class IloUefiHttpsBoot(base.BootInterface):
except exception.ImageRefValidationFailed:
with excutils.save_and_reraise_exception():
LOG.error("UEFI-HTTPS boot with 'ramdisk' "
- "boot_option accepts only Glance images or "
+ "deploy accepts only Glance images or "
"HTTPS URLs as "
"instance_info['boot_iso']. Either %s "
"is not a valid HTTPS URL or is not "
diff --git a/ironic/drivers/modules/ilo/power.py b/ironic/drivers/modules/ilo/power.py
index ee8fcc794..a1363fb52 100644
--- a/ironic/drivers/modules/ilo/power.py
+++ b/ironic/drivers/modules/ilo/power.py
@@ -44,9 +44,8 @@ def _attach_boot_iso_if_needed(task):
This method checks the instance info of the baremetal node for a
boot iso. If the instance info has a value of key 'boot_iso',
- it indicates that 'boot_option' is 'netboot'. Therefore it attaches
- the boot ISO on the baremetal node and then sets the node to boot from
- virtual media cdrom.
+ it indicates ramdisk deploy. Therefore it attaches the boot ISO on the
+ baremetal node and then sets the node to boot from virtual media cdrom.
:param task: a TaskManager instance containing the node to act on.
"""
diff --git a/ironic/drivers/modules/ipxe_config.template b/ironic/drivers/modules/ipxe_config.template
index 7f348bb2f..650083869 100644
--- a/ironic/drivers/modules/ipxe_config.template
+++ b/ironic/drivers/modules/ipxe_config.template
@@ -25,12 +25,6 @@ echo Powering off in 30 seconds.
sleep 30
poweroff
-:boot_partition
-imgfree
-kernel {% if pxe_options.ipxe_timeout > 0 %}--timeout {{ pxe_options.ipxe_timeout }} {% endif %}{{ pxe_options.aki_path }} root={{ ROOT }} ro text {{ pxe_options.pxe_append_params|default("", true) }} initrd=ramdisk || goto boot_partition
-initrd {% if pxe_options.ipxe_timeout > 0 %}--timeout {{ pxe_options.ipxe_timeout }} {% endif %}{{ pxe_options.ari_path }} || goto boot_partition
-boot
-
:boot_anaconda
imgfree
kernel {% if pxe_options.ipxe_timeout > 0 %}--timeout {{ pxe_options.ipxe_timeout }} {% endif %}{{ pxe_options.aki_path }} text {{ pxe_options.pxe_append_params|default("", true) }} inst.ks={{ pxe_options.ks_cfg_url }} {% if pxe_options.repo_url %}inst.repo={{ pxe_options.repo_url }}{% else %}inst.stage2={{ pxe_options.stage2_url }}{% endif %} initrd=ramdisk || goto boot_anaconda
diff --git a/ironic/drivers/modules/irmc/boot.py b/ironic/drivers/modules/irmc/boot.py
index 84964bd2f..11153a6f1 100644
--- a/ironic/drivers/modules/irmc/boot.py
+++ b/ironic/drivers/modules/irmc/boot.py
@@ -376,9 +376,8 @@ def attach_boot_iso_if_needed(task):
This method checks the instance info of the bare metal node for a
boot ISO. If the instance info has a value of key 'boot_iso',
- it indicates that 'boot_option' is 'netboot'. Threfore it attaches
- the boot ISO on the bare metal node and then sets the node to boot from
- virtual media cdrom.
+ it indicates ramdisk deploy. Therefore it attaches the boot ISO on the bare
+ metal node and then sets the node to boot from virtual media cdrom.
:param task: a TaskManager instance containing the node to act on.
:raises: IRMCOperationError if attaching virtual media failed.
diff --git a/ironic/drivers/modules/network/neutron.py b/ironic/drivers/modules/network/neutron.py
index 3e4dcbfd6..2693b603e 100644
--- a/ironic/drivers/modules/network/neutron.py
+++ b/ironic/drivers/modules/network/neutron.py
@@ -20,9 +20,7 @@ from oslo_log import log
from ironic.common import exception
from ironic.common.i18n import _
from ironic.common import neutron
-from ironic.common import states
from ironic.drivers import base
-from ironic.drivers.modules import deploy_utils
from ironic.drivers.modules.network import common
LOG = log.getLogger(__name__)
@@ -61,15 +59,6 @@ class NeutronNetwork(common.NeutronVIFPortIDMixin,
"""
self.get_cleaning_network_uuid(task)
self.get_provisioning_network_uuid(task)
- node = task.node
- if (node.provision_state == states.DEPLOYING
- and node.driver_internal_info.get('is_whole_disk_image')
- and deploy_utils.get_boot_option(node) == 'netboot'):
- error_msg = (_('The node %s cannot perform "local" boot for '
- 'whole disk image when node is using "neutron" '
- 'network and is configured with "netboot" boot '
- 'option.') % node.uuid)
- raise exception.InvalidParameterValue(error_msg)
def _add_network(self, task, network, security_groups, process):
# If we have left over ports from a previous process, remove them
diff --git a/ironic/drivers/modules/pxe_base.py b/ironic/drivers/modules/pxe_base.py
index a8a768b8b..daa90ba8d 100644
--- a/ironic/drivers/modules/pxe_base.py
+++ b/ironic/drivers/modules/pxe_base.py
@@ -261,50 +261,6 @@ class PXEBaseMixin(object):
anaconda_boot=(boot_option == "kickstart"))
boot_device = boot_devices.PXE
- elif boot_option != "local":
- if task.driver.storage.should_write_image(task):
- # Make sure that the instance kernel/ramdisk is cached.
- # This is for the takeover scenario for active nodes.
- instance_image_info = pxe_utils.get_instance_image_info(
- task, ipxe_enabled=self.ipxe_enabled)
- pxe_utils.cache_ramdisk_kernel(task, instance_image_info,
- ipxe_enabled=self.ipxe_enabled)
-
- # If it's going to PXE boot we need to update the DHCP server
- dhcp_opts = pxe_utils.dhcp_options_for_instance(
- task, ipxe_enabled=self.ipxe_enabled, ip_version=4)
- dhcp_opts += pxe_utils.dhcp_options_for_instance(
- task, ipxe_enabled=self.ipxe_enabled, ip_version=6)
- provider = dhcp_factory.DHCPFactory()
- provider.update_dhcp(task, dhcp_opts)
-
- iwdi = task.node.driver_internal_info.get('is_whole_disk_image')
- try:
- root_uuid_or_disk_id = task.node.driver_internal_info[
- 'root_uuid_or_disk_id'
- ]
- except KeyError:
- if not task.driver.storage.should_write_image(task):
- pass
- elif not iwdi:
- LOG.warning("The UUID for the root partition can't be "
- "found, unable to switch the pxe config from "
- "deployment mode to service (boot) mode for "
- "node %(node)s", {"node": task.node.uuid})
- else:
- LOG.warning("The disk id for the whole disk image can't "
- "be found, unable to switch the pxe config "
- "from deployment mode to service (boot) mode "
- "for node %(node)s. Booting the instance "
- "from disk.", {"node": task.node.uuid})
- pxe_utils.clean_up_pxe_config(
- task, ipxe_enabled=self.ipxe_enabled)
- boot_device = boot_devices.DISK
- else:
- pxe_utils.build_service_pxe_config(
- task, instance_image_info, root_uuid_or_disk_id,
- ipxe_enabled=self.ipxe_enabled)
- boot_device = boot_devices.PXE
else:
# NOTE(dtantsur): create a PXE configuration as a safety net for
# hardware uncapable of persistent boot. If on a reboot it will try
diff --git a/ironic/drivers/modules/pxe_config.template b/ironic/drivers/modules/pxe_config.template
index 9b773b2ba..bf4cec11a 100644
--- a/ironic/drivers/modules/pxe_config.template
+++ b/ironic/drivers/modules/pxe_config.template
@@ -5,12 +5,6 @@ kernel {{ pxe_options.deployment_aki_path }}
append initrd={{ pxe_options.deployment_ari_path }} selinux=0 troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }}
ipappend 2
-
-label boot_partition
-kernel {{ pxe_options.aki_path }}
-append initrd={{ pxe_options.ari_path }} root={{ ROOT }} ro text {{ pxe_options.pxe_append_params|default("", true) }}
-
-
label boot_whole_disk
COM32 chain.c32
append mbr:{{ DISK_IDENTIFIER }}
diff --git a/ironic/drivers/modules/pxe_grub_config.template b/ironic/drivers/modules/pxe_grub_config.template
index d33cbb8cd..d8fc48673 100644
--- a/ironic/drivers/modules/pxe_grub_config.template
+++ b/ironic/drivers/modules/pxe_grub_config.template
@@ -7,11 +7,6 @@ menuentry "deploy" {
initrdefi {{ pxe_options.deployment_ari_path }}
}
-menuentry "boot_partition" {
- linuxefi {{ pxe_options.aki_path }} root={{ ROOT }} ro text {{ pxe_options.pxe_append_params|default("", true) }} boot_server={{pxe_options.tftp_server}}
- initrdefi {{ pxe_options.ari_path }}
-}
-
menuentry "boot_ramdisk" {
linuxefi {{ pxe_options.aki_path }} root=/dev/ram0 text {{ pxe_options.pxe_append_params|default("", true) }} {{ pxe_options.ramdisk_opts|default('', true) }}
initrdefi {{ pxe_options.ari_path }}