Add "agent_wol" (AgentAndWakeOnLanDriver)

This patch adds new driver with WakeOnLanPower and AgentDeploy
interfaces. Automatic deploy is possible because AgentDeploy
does soft power off at the end of deploy cycle.

Change-Id: I09dc41c1523fafc5155a02829f9528d65cf2f5b0
This commit is contained in:
Yuriy Zveryanskyy 2015-10-30 14:55:04 +02:00
parent f05b139205
commit 977d1f1f78
4 changed files with 55 additions and 0 deletions

View File

@ -97,6 +97,31 @@ which is the value of *$NODE* in the following command.
ironic port-create -n $NODE -a <MAC address>
agent_wol
^^^^^^^^^
Overview
~~~~~~~~
The ``agent_wol`` driver uses the Wake-On-Lan technology to control the
power state, PXE/iPXE technology for booting and the Ironic Python Agent
for deploying the node.
Additional requirements
~~~~~~~~~~~~~~~~~~~~~~~
* Boot device order should be set to "PXE, DISK" in the BIOS setup
* BIOS must try next boot device if PXE boot failed
* Cleaning should be disabled, see :ref:`cleaning`
* Node should be powered off before start of deploy
Configuration steps are the same as for ``pxe_wol`` driver, replace "pxe_wol"
with "agent_wol".
References
==========
.. [1] Wake-On-Lan - https://en.wikipedia.org/wiki/Wake-on-LAN

View File

@ -30,6 +30,7 @@ from ironic.drivers.modules import ssh
from ironic.drivers.modules.ucs import management as ucs_mgmt
from ironic.drivers.modules.ucs import power as ucs_power
from ironic.drivers.modules import virtualbox
from ironic.drivers.modules import wol
from ironic.drivers import utils
@ -212,3 +213,19 @@ class AgentAndCIMCDriver(base.BaseDriver):
self.deploy = agent.AgentDeploy()
self.management = cimc_mgmt.CIMCManagement()
self.vendor = agent.AgentVendorInterface()
class AgentAndWakeOnLanDriver(base.BaseDriver):
"""Agent + WakeOnLan driver.
This driver implements the `core` functionality, combining
:class:`ironic.drivers.modules.wol.WakeOnLanPower` for power on 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):
self.power = wol.WakeOnLanPower()
self.boot = pxe.PXEBoot()
self.deploy = agent.AgentDeploy()
self.vendor = agent.AgentVendorInterface()

View File

@ -25,6 +25,7 @@ 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 pxe
from ironic.drivers.modules import wol
class AgentAndAMTDriverTestCase(testtools.TestCase):
@ -47,3 +48,14 @@ class AgentAndAMTDriverTestCase(testtools.TestCase):
self.assertRaises(exception.DriverLoadError,
agent.AgentAndAMTDriver)
class AgentAndWakeOnLanDriverTestCase(testtools.TestCase):
def test___init__(self):
driver = agent.AgentAndWakeOnLanDriver()
self.assertIsInstance(driver.power, wol.WakeOnLanPower)
self.assertIsInstance(driver.boot, pxe.PXEBoot)
self.assertIsInstance(driver.deploy, agent_module.AgentDeploy)
self.assertIsInstance(driver.vendor, agent_module.AgentVendorInterface)

View File

@ -41,6 +41,7 @@ ironic.drivers =
agent_ssh = ironic.drivers.agent:AgentAndSSHDriver
agent_vbox = ironic.drivers.agent:AgentAndVirtualBoxDriver
agent_ucs = ironic.drivers.agent:AgentAndUcsDriver
agent_wol = ironic.drivers.agent:AgentAndWakeOnLanDriver
fake = ironic.drivers.fake:FakeDriver
fake_agent = ironic.drivers.fake:FakeAgentDriver
fake_inspector = ironic.drivers.fake:FakeIPMIToolInspectorDriver