diff --git a/doc/source/drivers/iboot.rst b/doc/source/drivers/iboot.rst index 5d4ea202ae..e6ba6b65a4 100644 --- a/doc/source/drivers/iboot.rst +++ b/doc/source/drivers/iboot.rst @@ -12,15 +12,15 @@ management of nodes using Dataprobe iBoot devices over the DxP protocol. Drivers ======= -pxe_iboot -^^^^^^^^^ +There are two iboot drivers: -Overview -~~~~~~~~ +* The ``pxe_iboot`` driver uses iBoot to control the power state of the + node, PXE/iPXE technology for booting and the iSCSI methodology for + deploying the node. -The ``pxe_iboot`` driver uses iBoot to control the power state of the -node, PXE/iPXE technology for booting and the iSCSI methodology for -deploying the node. +* The ``agent_iboot`` driver uses iBoot to control the power state of the + node, PXE/iPXE technology for booting and the Ironic Python Agent for + deploying an image to the node. Requirements ~~~~~~~~~~~~ @@ -35,12 +35,12 @@ Tested platforms Configuring and enabling the driver ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1. Add ``pxe_iboot`` to the list of ``enabled_drivers`` in - */etc/ironic/ironic.conf*. For example:: +1. Add ``pxe_iboot`` and/or ``agent_iboot`` to the list of ``enabled_drivers`` + in */etc/ironic/ironic.conf*. For example:: [DEFAULT] ... - enabled_drivers = pxe_ipmitool,pxe_iboot + enabled_drivers = pxe_iboot,agent_iboot 2. Restart the Ironic conductor service:: @@ -50,7 +50,7 @@ Registering a node with the iBoot driver ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Nodes configured for the iBoot driver should have the ``driver`` property -set to ``pxe_iboot``. +set to ``pxe_iboot`` or ``agent_iboot``. The following configuration values are also required in ``driver_info``: diff --git a/ironic/drivers/agent.py b/ironic/drivers/agent.py index 7891f593de..020fa3d335 100644 --- a/ironic/drivers/agent.py +++ b/ironic/drivers/agent.py @@ -22,6 +22,7 @@ from ironic.drivers.modules.amt import management as amt_management from ironic.drivers.modules.amt import power as amt_power from ironic.drivers.modules.cimc import management as cimc_mgmt from ironic.drivers.modules.cimc import power as cimc_power +from ironic.drivers.modules import iboot from ironic.drivers.modules import inspector from ironic.drivers.modules import ipminative from ironic.drivers.modules import ipmitool @@ -229,3 +230,24 @@ class AgentAndWakeOnLanDriver(base.BaseDriver): self.boot = pxe.PXEBoot() self.deploy = agent.AgentDeploy() self.vendor = agent.AgentVendorInterface() + + +class AgentAndIBootDriver(base.BaseDriver): + """Agent + IBoot PDU driver. + + This driver implements the `core` functionality, combining + :class:`ironic.drivers.modules.iboot.IBootPower` for power + on/off and reboot with + :class:'ironic.driver.modules.agent.AgentDeploy' (for image deployment.) + Implementations are in those respective classes; + this class is merely the glue between them. + """ + def __init__(self): + if not importutils.try_import('iboot'): + raise exception.DriverLoadError( + driver=self.__class__.__name__, + reason=_("Unable to import iboot library")) + self.power = iboot.IBootPower() + self.boot = pxe.PXEBoot() + self.deploy = agent.AgentDeploy() + self.vendor = agent.AgentVendorInterface() diff --git a/ironic/tests/unit/drivers/test_agent.py b/ironic/tests/unit/drivers/test_agent.py index 7a994718c1..1a1439282c 100644 --- a/ironic/tests/unit/drivers/test_agent.py +++ b/ironic/tests/unit/drivers/test_agent.py @@ -24,6 +24,7 @@ from ironic.drivers import agent from ironic.drivers.modules import agent as agent_module from ironic.drivers.modules.amt import management as amt_management from ironic.drivers.modules.amt import power as amt_power +from ironic.drivers.modules import iboot from ironic.drivers.modules import pxe from ironic.drivers.modules import wol @@ -59,3 +60,14 @@ class AgentAndWakeOnLanDriverTestCase(testtools.TestCase): self.assertIsInstance(driver.boot, pxe.PXEBoot) self.assertIsInstance(driver.deploy, agent_module.AgentDeploy) self.assertIsInstance(driver.vendor, agent_module.AgentVendorInterface) + + +class AgentAndIBootDriverTestCase(testtools.TestCase): + + def test___init__(self): + driver = agent.AgentAndIBootDriver() + + self.assertIsInstance(driver.power, iboot.IBootPower) + self.assertIsInstance(driver.boot, pxe.PXEBoot) + self.assertIsInstance(driver.deploy, agent_module.AgentDeploy) + self.assertIsInstance(driver.vendor, agent_module.AgentVendorInterface) diff --git a/setup.cfg b/setup.cfg index 93029fcc5f..a5ecc11fc9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,6 +33,7 @@ ironic.dhcp = ironic.drivers = agent_amt = ironic.drivers.agent:AgentAndAMTDriver + agent_iboot = ironic.drivers.agent:AgentAndIBootDriver agent_ilo = ironic.drivers.ilo:IloVirtualMediaAgentDriver agent_ipmitool = ironic.drivers.agent:AgentAndIPMIToolDriver agent_irmc = ironic.drivers.irmc:IRMCVirtualMediaAgentDriver