From 66b07398310db1b4c26e1ba9fda247328478ed67 Mon Sep 17 00:00:00 2001 From: Vanou Ishii Date: Thu, 27 Jun 2019 03:46:40 -0400 Subject: [PATCH] Deal with iPXE boot interface incompatibility in Train In Train cycle, iPXE boot with [pxe]ipxe_enabled option in ironic.conf file will be removed. And ipxe boot interface will be the only boot interface to deploy Ironic node with iPXE. Till Train, iRMC driver has supported iPXE boot with [pxe]ipxe_enabled option. This commit copes with this incompatibility and supports ipxe boot interface by adding ipxe.iPXEBoot to supported_boot_interface. Change-Id: Iec2284c2d101aebadd9d1b531c44794e2d4efacf Related-Bug: #1628069 --- ironic/drivers/irmc.py | 3 ++- ironic/tests/unit/drivers/test_irmc.py | 11 ++++++++++- ...erface-incompatibility-7d0b2bdb8f9deb46.yaml | 17 +++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/irmc-dealing-with-ipxe-boot-interface-incompatibility-7d0b2bdb8f9deb46.yaml diff --git a/ironic/drivers/irmc.py b/ironic/drivers/irmc.py index 0a61e1fb1f..f3c2d7c65f 100644 --- a/ironic/drivers/irmc.py +++ b/ironic/drivers/irmc.py @@ -20,6 +20,7 @@ from ironic.drivers import generic from ironic.drivers.modules import agent from ironic.drivers.modules import inspector from ironic.drivers.modules import ipmitool +from ironic.drivers.modules import ipxe from ironic.drivers.modules.irmc import bios from ironic.drivers.modules.irmc import boot from ironic.drivers.modules.irmc import inspect @@ -48,7 +49,7 @@ class IRMCHardware(generic.GenericHardware): # NOTE: Support for pxe boot is deprecated, and will be # removed from the list in the future. return [boot.IRMCVirtualMediaBoot, boot.IRMCPXEBoot, - pxe.PXEBoot] + ipxe.iPXEBoot, pxe.PXEBoot] @property def supported_console_interfaces(self): diff --git a/ironic/tests/unit/drivers/test_irmc.py b/ironic/tests/unit/drivers/test_irmc.py index ba1cf88192..abfc12b425 100644 --- a/ironic/tests/unit/drivers/test_irmc.py +++ b/ironic/tests/unit/drivers/test_irmc.py @@ -21,6 +21,7 @@ from ironic.drivers import irmc from ironic.drivers.modules import agent from ironic.drivers.modules import inspector from ironic.drivers.modules import ipmitool +from ironic.drivers.modules import ipxe from ironic.drivers.modules.irmc import bios as irmc_bios from ironic.drivers.modules.irmc import raid from ironic.drivers.modules import iscsi_deploy @@ -35,8 +36,9 @@ class IRMCHardwareTestCase(db_base.DbTestCase): irmc.boot.check_share_fs_mounted_patcher.start() self.addCleanup(irmc.boot.check_share_fs_mounted_patcher.stop) super(IRMCHardwareTestCase, self).setUp() + self.config_temp_dir('http_root', group='deploy') self.config(enabled_hardware_types=['irmc'], - enabled_boot_interfaces=['irmc-virtual-media'], + enabled_boot_interfaces=['irmc-virtual-media', 'ipxe'], enabled_console_interfaces=['ipmitool-socat'], enabled_deploy_interfaces=['iscsi', 'direct'], enabled_inspect_interfaces=['irmc'], @@ -185,3 +187,10 @@ class IRMCHardwareTestCase(db_base.DbTestCase): noop.NoBIOS) self.assertIsInstance(task.driver.rescue, agent.AgentRescue) + + def test_override_with_boot_configuration(self): + node = obj_utils.create_test_node( + self.context, driver='irmc', + boot_interface='ipxe') + with task_manager.acquire(self.context, node.id) as task: + self.assertIsInstance(task.driver.boot, ipxe.iPXEBoot) diff --git a/releasenotes/notes/irmc-dealing-with-ipxe-boot-interface-incompatibility-7d0b2bdb8f9deb46.yaml b/releasenotes/notes/irmc-dealing-with-ipxe-boot-interface-incompatibility-7d0b2bdb8f9deb46.yaml new file mode 100644 index 0000000000..6d576f515a --- /dev/null +++ b/releasenotes/notes/irmc-dealing-with-ipxe-boot-interface-incompatibility-7d0b2bdb8f9deb46.yaml @@ -0,0 +1,17 @@ +--- +upgrade: + - | + iRMC hardware type deals with iPXE boot interface incompatibility. + To iPXE boot with ``ipxe`` boot interface, *(1)* add ``ipxe`` to + ``enabled_boot_interfaces`` in ``ironic.conf``, *(2)* set up tftp & + http server following `Ironic document on iPXE boot configuration + `, + then *(3)* create/set baremetal node with ``--boot-interface ipxe``. +fixes: + - | + iRMC hardware type deals with iPXE boot interface incompatibility. + From Stein, ``[pxe]ipxe_enabled`` option has been deprecated and will be + removed in preference to ``ipxe`` boot interface in Train cycle. Till then, + iRMC hardware type supports iPXE boot through ``[pxe]ipxe_enabled`` option. + To cope with this incompatibility, iRMC hardware type supports ``ipxe`` + boot interface.