Remove the deprecated classic drivers for Cisco UCS hardware

This change removes pxe_ucs, agent_ucs, pxe_iscsi_cimc and
pxe_agent_cimc. Best effort clean up was done to the documentation.

Change-Id: I4fe75e0d4a36228f2f6be6bf6ced6d37424b6fd3
This commit is contained in:
Dmitry Tantsur 2018-06-25 15:01:23 +02:00
parent 09e89c09d1
commit 575640cfac
9 changed files with 35 additions and 269 deletions

View File

@ -104,10 +104,10 @@ IRONIC_HW_ARCH=${IRONIC_HW_ARCH:-x86_64}
# *_ipmitool or ipmi:
# <BMC address> <MAC address> <BMC username> <BMC password>
#
# *_cimc:
# cisco-ucs-standalone:
# <BMC address> <MAC address> <BMC username> <BMC password>
#
# *_ucs:
# cisco-ucs-managed:
# <BMC address> <MAC address> <BMC username> <BMC password> <UCS service profile>
#
# *_oneview:
@ -292,7 +292,7 @@ fi
# are ``pxe_ipmitool``, ``agent_ipmitool``, ``pxe_snmp`` and ``ipmi``.
#
# Additional valid choices if IRONIC_IS_HARDWARE == true are:
# ``pxe_iscsi_cimc``, ``pxe_agent_cimc``, ``pxe_ucs``, ``pxe_cimc``,
# ``cisco-ucs-managed``, ``cisco-ucs-standalone``
# ``*_pxe_oneview`` and ``idrac``
IRONIC_DEPLOY_DRIVER=${IRONIC_DEPLOY_DRIVER:-pxe_ipmitool}
@ -620,12 +620,12 @@ function is_deployed_by_ipmitool {
}
function is_deployed_by_cimc {
[[ -z "${IRONIC_DEPLOY_DRIVER##*_cimc}" ]] && return 0
[[ "${IRONIC_DEPLOY_DRIVER}" == cisco-ucs-standalone ]] && return 0
return 1
}
function is_deployed_by_ucs {
[[ -z "${IRONIC_DEPLOY_DRIVER##*_ucs}" ]] && return 0
[[ "${IRONIC_DEPLOY_DRIVER}" == cisco-ucs-managed ]] && return 0
return 1
}

View File

@ -6,23 +6,14 @@ CIMC drivers
Overview
========
The CIMC drivers are targeted for standalone Cisco UCS C series servers.
These drivers enable you to take advantage of CIMC by using the
python SDK.
``pxe_iscsi_cimc`` driver uses PXE boot + iSCSI deploy (just like ``pxe_ipmitool``
driver) to deploy the image and uses CIMC to do all management operations on
the baremetal node (instead of using IPMI).
The ``cisco-ucs-standalone`` hardware type targets standalone Cisco UCS C
series servers. It enables you to take advantage of CIMC by using
the python SDK.
``pxe_agent_cimc`` driver uses PXE boot + Agent deploy (just like ``agent_ipmitool``
and ``agent_ipminative`` drivers.) to deploy the image and uses CIMC to do all
management operations on the baremetal node (instead of using IPMI). Unlike with
iSCSI deploy in Agent deploy, the ramdisk is responsible for writing the image to
the disk, instead of the conductor.
The CIMC drivers can use the Ironic Inspector service for in-band inspection of
equipment. For more information see the `Ironic Inspector documentation
<https://docs.openstack.org/ironic-inspector/latest>`_.
The CIMC hardware type can use the Ironic Inspector service for in-band
inspection of equipment. For more information see the `Ironic Inspector
documentation <https://docs.openstack.org/ironic-inspector/latest>`_.
Prerequisites
=============
@ -50,10 +41,10 @@ This driver works with UCS C-Series servers and has been tested with:
Configuring and Enabling the driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Add ``pxe_iscsi_cimc`` and/or ``pxe_agent_cimc`` to the list of ``enabled_drivers`` in
1. Add ``cisco-ucs-standalone`` to ``enabled_hardware_types`` in
``/etc/ironic/ironic.conf``. For example::
enabled_drivers = pxe_ipmitool,pxe_iscsi_cimc,pxe_agent_cimc
enabled_hardware_types = ipmi,cisco-ucs-standalone
2. Restart the Ironic conductor service:
@ -68,8 +59,8 @@ Configuring and Enabling the driver
Registering CIMC Managed UCS node in Ironic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nodes configured for CIMC driver should have the ``driver`` property set to
``pxe_iscsi_cimc`` or ``pxe_agent_cimc``. The following configuration values are
also required in ``driver_info``:
``cisco-ucs-standalone``. The following configuration values are also required
in ``driver_info``:
- ``cimc_address``: IP address or hostname for CIMC
- ``cimc_username``: CIMC login user name
@ -81,7 +72,7 @@ The following sequence of commands can be used to enroll a UCS Standalone node.
* Create Node::
openstack baremetal node create --driver <pxe_iscsi_cimc OR pxe_agent_cimc> \
openstack baremetal node create --driver cisco-ucs-standalone \
--driver-info cimc_address=<CIMC hostname OR ip-address> \
--driver-info cimc_username=<cimc_username> \
--driver-info cimc_password=<cimc_password> \

View File

@ -6,21 +6,14 @@ UCS drivers
Overview
========
The UCS driver is targeted for UCS Manager managed Cisco UCS B/C series
servers. The pxe_ucs, agent_ucs drivers enables you to take advantage of
UCS Manager by using the python SDK.
servers. The ``cisco-ucs-managed`` hardware type enables you to take advantage
of UCS Manager by using the python SDK.
``pxe_ucs`` driver uses PXE/iSCSI (just like ``pxe_ipmitool`` driver) to
deploy the image and uses UCS to do all management operations on the
baremetal node (instead of using IPMI).
``agent_ucs`` driver uses IPA ramdisk (just like ``agent_ipmitool`` and
``agent_ipminative`` drivers.) to deploy the image and uses UCS to do all
management operations on the baremetal node (instead of using IPMI).
The UCS drivers can use the Ironic Inspector service for in-band inspection of
equipment. For more information see the `Ironic Inspector documentation
<https://docs.openstack.org/ironic-inspector/latest>`_.
The UCS hardware type can use the Ironic Inspector service for in-band
inspection of equipment. For more information see the `Ironic Inspector
documentation <https://docs.openstack.org/ironic-inspector/latest>`_.
Prerequisites
=============
@ -48,10 +41,10 @@ by this driver.
Configuring and Enabling the driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Add ``pxe_ucs`` and/or ``agent_ucs`` to the list of ``enabled_drivers`` in
1. Add ``cisco-ucs-managed`` to the ``enabled_hardware_types`` in
``/etc/ironic/ironic.conf``. For example::
enabled_drivers = pxe_ipmitool,pxe_ucs,agent_ucs
enabled_hardware_types = ipmi,cisco-ucs-managed
2. Restart the Ironic conductor service::
@ -60,7 +53,7 @@ Configuring and Enabling the driver
Registering UCS node in Ironic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nodes configured for UCS driver should have the ``driver`` property set to
``pxe_ucs/agent_ucs``. The following configuration values are also required in
``cisco-ucs-managed``. The following configuration values are also required in
``driver_info``:
- ``ucs_address``: IP address or hostname of the UCS Manager
@ -75,7 +68,7 @@ The following sequence of commands can be used to enroll a UCS node.
* Create Node::
openstack baremetal node create --driver <pxe_ucs/agent_ucs> \
openstack baremetal node create --driver cisco-ucs-managed \
--driver-info ucs_address=<UCS Manager hostname/ip-address> \
--driver-info ucs_username=<ucsm_username> \
--driver-info ucs_password=<ucsm_password> \

View File

@ -25,8 +25,7 @@ when creating or updating a node::
openstack baremetal node set <NODE> --deploy-interface iscsi
The ``iscsi`` deploy interface is also used in all of the *classic drivers*
with names starting with ``pxe_`` (except for ``pxe_agent_cimc``)
and ``iscsi_``.
with names starting with ``pxe_`` and ``iscsi_``.
.. _iSCSI: https://en.wikipedia.org/wiki/ISCSI

View File

@ -12,103 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo_config import cfg
from oslo_utils import importutils
from ironic.common import exception
from ironic.common.i18n import _
from ironic.drivers import base
from ironic.drivers import ipmi
from ironic.drivers.modules import agent
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 inspector
from ironic.drivers.modules import pxe
from ironic.drivers.modules.ucs import management as ucs_mgmt
from ironic.drivers.modules.ucs import power as ucs_power
CONF = cfg.CONF
# For backward compatibility
AgentAndIPMIToolDriver = ipmi.AgentAndIPMIToolDriver
AgentAndIPMIToolAndSocatDriver = ipmi.AgentAndIPMIToolAndSocatDriver
class AgentAndUcsDriver(base.BaseDriver):
"""Agent + Cisco UCSM driver.
This driver implements the `core` functionality, combining
:class:ironic.drivers.modules.ucs.power.Power 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('UcsSdk'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import UcsSdk library"))
self.power = ucs_power.Power()
self.boot = pxe.PXEBoot()
self.deploy = agent.AgentDeploy()
self.management = ucs_mgmt.UcsManagement()
self.inspect = inspector.Inspector.create_if_enabled(
'AgentAndUcsDriver')
@classmethod
def to_hardware_type(cls):
# NOTE(dtantsur): classic drivers are not affected by the
# enabled_inspect_interfaces configuration option.
if CONF.inspector.enabled:
inspect_interface = 'inspector'
else:
inspect_interface = 'no-inspect'
return 'cisco-ucs-managed', {'boot': 'pxe',
'deploy': 'direct',
'inspect': inspect_interface,
'management': 'ucsm',
'power': 'ucsm'}
class AgentAndCIMCDriver(base.BaseDriver):
"""Agent + Cisco CIMC driver.
This driver implements the `core` functionality, combining
:class:ironic.drivers.modules.cimc.power.Power 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('ImcSdk'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import ImcSdk library"))
self.power = cimc_power.Power()
self.boot = pxe.PXEBoot()
self.deploy = agent.AgentDeploy()
self.management = cimc_mgmt.CIMCManagement()
self.inspect = inspector.Inspector.create_if_enabled(
'AgentAndCIMCDriver')
@classmethod
def to_hardware_type(cls):
# NOTE(dtantsur): classic drivers are not affected by the
# enabled_inspect_interfaces configuration option.
if CONF.inspector.enabled:
inspect_interface = 'inspector'
else:
inspect_interface = 'no-inspect'
return 'cisco-ucs-standalone', {'boot': 'pxe',
'deploy': 'direct',
'inspect': inspect_interface,
'management': 'cimc',
'power': 'cimc'}

View File

@ -24,9 +24,6 @@ from ironic.common import exception
from ironic.common.i18n import _
from ironic.drivers import base
from ironic.drivers import ipmi
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 inspector
from ironic.drivers.modules import ipmitool
from ironic.drivers.modules.irmc import boot as irmc_boot
from ironic.drivers.modules.irmc import inspect as irmc_inspect
@ -35,8 +32,6 @@ from ironic.drivers.modules.irmc import power as irmc_power
from ironic.drivers.modules import iscsi_deploy
from ironic.drivers.modules import pxe
from ironic.drivers.modules import snmp
from ironic.drivers.modules.ucs import management as ucs_mgmt
from ironic.drivers.modules.ucs import power as ucs_power
CONF = cfg.CONF
@ -109,79 +104,3 @@ class PXEAndIRMCDriver(base.BaseDriver):
'inspect': 'irmc',
'management': 'irmc',
'power': 'irmc'}
class PXEAndUcsDriver(base.BaseDriver):
"""PXE + Cisco UCSM driver.
This driver implements the `core` functionality, combining
:class:ironic.drivers.modules.ucs.power.Power for power
on/off and reboot with
:class:ironic.drivers.modules.iscsi_deploy.ISCSIDeploy 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('UcsSdk'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import UcsSdk library"))
self.power = ucs_power.Power()
self.boot = pxe.PXEBoot()
self.deploy = iscsi_deploy.ISCSIDeploy()
self.management = ucs_mgmt.UcsManagement()
self.inspect = inspector.Inspector.create_if_enabled(
'PXEAndUcsDriver')
@classmethod
def to_hardware_type(cls):
# NOTE(dtantsur): classic drivers are not affected by the
# enabled_inspect_interfaces configuration option.
if CONF.inspector.enabled:
inspect_interface = 'inspector'
else:
inspect_interface = 'no-inspect'
return 'cisco-ucs-managed', {'boot': 'pxe',
'deploy': 'iscsi',
'inspect': inspect_interface,
'management': 'ucsm',
'power': 'ucsm'}
class PXEAndCIMCDriver(base.BaseDriver):
"""PXE + Cisco IMC driver.
This driver implements the 'core' functionality, combining
:class:`ironic.drivers.modules.cimc.Power` for power on/off and reboot with
:class:`ironic.drivers.modules.pxe.PXEBoot` for booting the node and
:class:`ironic.drivers.modules.iscsi_deploy.ISCSIDeploy` for image
deployment. Implentations are in those respective classes; this
class is merely the glue between them.
"""
def __init__(self):
if not importutils.try_import('ImcSdk'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import ImcSdk library"))
self.power = cimc_power.Power()
self.boot = pxe.PXEBoot()
self.deploy = iscsi_deploy.ISCSIDeploy()
self.management = cimc_mgmt.CIMCManagement()
self.inspect = inspector.Inspector.create_if_enabled(
'PXEAndCIMCDriver')
@classmethod
def to_hardware_type(cls):
# NOTE(dtantsur): classic drivers are not affected by the
# enabled_inspect_interfaces configuration option.
if CONF.inspector.enabled:
inspect_interface = 'inspector'
else:
inspect_interface = 'no-inspect'
return 'cisco-ucs-standalone', {'boot': 'pxe',
'deploy': 'iscsi',
'inspect': inspect_interface,
'management': 'cimc',
'power': 'cimc'}

View File

@ -20,8 +20,6 @@ import mock
import testtools
from ironic.common import exception
from ironic.drivers.modules.cimc import management as cimc_management
from ironic.drivers.modules.cimc import power as cimc_power
from ironic.drivers.modules import ipmitool
from ironic.drivers.modules.irmc import boot as irmc_boot
from ironic.drivers.modules.irmc import management as irmc_management
@ -29,8 +27,6 @@ from ironic.drivers.modules.irmc import power as irmc_power
from ironic.drivers.modules import iscsi_deploy
from ironic.drivers.modules import pxe as pxe_module
from ironic.drivers.modules import snmp
from ironic.drivers.modules.ucs import management as ucs_management
from ironic.drivers.modules.ucs import power as ucs_power
from ironic.drivers import pxe
@ -77,45 +73,3 @@ class PXEDriversTestCase(testtools.TestCase):
self.assertRaises(exception.DriverLoadError,
pxe.PXEAndIRMCDriver)
@mock.patch.object(pxe.importutils, 'try_import', spec_set=True,
autospec=True)
def test_pxe_ucs_driver(self, try_import_mock):
try_import_mock.return_value = True
driver = pxe.PXEAndUcsDriver()
self.assertIsInstance(driver.power, ucs_power.Power)
self.assertIsInstance(driver.boot, pxe_module.PXEBoot)
self.assertIsInstance(driver.deploy, iscsi_deploy.ISCSIDeploy)
self.assertIsInstance(driver.management,
ucs_management.UcsManagement)
@mock.patch.object(pxe.importutils, 'try_import', spec_set=True,
autospec=True)
def test_pxe_ucs_driver_import_error(self, try_import_mock):
try_import_mock.return_value = False
self.assertRaises(exception.DriverLoadError,
pxe.PXEAndUcsDriver)
@mock.patch.object(pxe.importutils, 'try_import', spec_set=True,
autospec=True)
def test_pxe_cimc_driver(self, try_import_mock):
try_import_mock.return_value = True
driver = pxe.PXEAndCIMCDriver()
self.assertIsInstance(driver.power, cimc_power.Power)
self.assertIsInstance(driver.boot, pxe_module.PXEBoot)
self.assertIsInstance(driver.deploy, iscsi_deploy.ISCSIDeploy)
self.assertIsInstance(driver.management,
cimc_management.CIMCManagement)
@mock.patch.object(pxe.importutils, 'try_import', spec_set=True,
autospec=True)
def test_pxe_cimc_driver_import_error(self, try_import_mock):
try_import_mock.return_value = False
self.assertRaises(exception.DriverLoadError,
pxe.PXEAndCIMCDriver)

View File

@ -0,0 +1,8 @@
---
upgrade:
- |
The deprecated classic drivers ``pxe_ucs`` and ``agent_ucs`` have been
removed. Please use the ``cisco-ucs-managed`` hardware type.
- |
The deprecated classic drivers ``pxe_iscsi_cimc`` and ``pxe_agent_cimc``
have been removed. Please use the ``cisco-ucs-standalone`` hardware type.

View File

@ -57,16 +57,12 @@ ironic.drivers =
agent_ipmitool_socat = ironic.drivers.ipmi:AgentAndIPMIToolAndSocatDriver
agent_irmc = ironic.drivers.irmc:IRMCVirtualMediaAgentDriver
agent_pxe_oneview = ironic.drivers.oneview:AgentPXEOneViewDriver
agent_ucs = ironic.drivers.agent:AgentAndUcsDriver
iscsi_irmc = ironic.drivers.irmc:IRMCVirtualMediaIscsiDriver
iscsi_pxe_oneview = ironic.drivers.oneview:ISCSIPXEOneViewDriver
pxe_ipmitool = ironic.drivers.ipmi:PXEAndIPMIToolDriver
pxe_ipmitool_socat = ironic.drivers.ipmi:PXEAndIPMIToolAndSocatDriver
pxe_snmp = ironic.drivers.pxe:PXEAndSNMPDriver
pxe_irmc = ironic.drivers.pxe:PXEAndIRMCDriver
pxe_ucs = ironic.drivers.pxe:PXEAndUcsDriver
pxe_iscsi_cimc = ironic.drivers.pxe:PXEAndCIMCDriver
pxe_agent_cimc = ironic.drivers.agent:AgentAndCIMCDriver
ironic.hardware.interfaces.bios =
fake = ironic.drivers.modules.fake:FakeBIOS