Remove the OneView classic drivers

This change removes iscsi_pxe_oneview and agent_pxe_oneview.

Change-Id: I4301e35f321bd041441dcfce494393fb90e293f3
This commit is contained in:
Dmitry Tantsur 2018-06-26 10:42:47 +02:00
parent 6deb0c3b0b
commit 384f966003
12 changed files with 57 additions and 373 deletions

View File

@ -110,7 +110,7 @@ IRONIC_HW_ARCH=${IRONIC_HW_ARCH:-x86_64}
# cisco-ucs-managed: # cisco-ucs-managed:
# <BMC address> <MAC address> <BMC username> <BMC password> <UCS service profile> # <BMC address> <MAC address> <BMC username> <BMC password> <UCS service profile>
# #
# *_oneview: # oneview:
# <Server Hardware URI> <Server Hardware Type URI> <Enclosure Group URI> <Server Profile Template URI> <MAC of primary connection> <Applied Server Profile URI> # <Server Hardware URI> <Server Hardware Type URI> <Enclosure Group URI> <Server Profile Template URI> <MAC of primary connection> <Applied Server Profile URI>
# #
# idrac: # idrac:
@ -292,8 +292,7 @@ fi
# are ``pxe_ipmitool``, ``agent_ipmitool``, ``snmp`` and ``ipmi``. # are ``pxe_ipmitool``, ``agent_ipmitool``, ``snmp`` and ``ipmi``.
# #
# Additional valid choices if IRONIC_IS_HARDWARE == true are: # Additional valid choices if IRONIC_IS_HARDWARE == true are:
# ``cisco-ucs-managed``, ``cisco-ucs-standalone`` # ``cisco-ucs-managed``, ``cisco-ucs-standalone``, ``oneview`` and ``idrac``.
# ``*_pxe_oneview`` and ``idrac``
IRONIC_DEPLOY_DRIVER=${IRONIC_DEPLOY_DRIVER:-pxe_ipmitool} IRONIC_DEPLOY_DRIVER=${IRONIC_DEPLOY_DRIVER:-pxe_ipmitool}
# If the requested driver is not yet enable, enable it, if it is not it will fail anyway # If the requested driver is not yet enable, enable it, if it is not it will fail anyway
@ -630,7 +629,8 @@ function is_deployed_by_ucs {
} }
function is_deployed_by_oneview { function is_deployed_by_oneview {
[[ -z "${IRONIC_DEPLOY_DRIVER##*_oneview}" ]] && return 0 [[ "${IRONIC_DEPLOY_DRIVER}" == oneview ]] && return 0
return 1
} }
function is_deployed_by_ilo { function is_deployed_by_ilo {

View File

@ -5,8 +5,8 @@ OneView drivers
=============== ===============
.. note:: .. note::
The `oneview` drivers and hardware type, along with related interfaces The `oneview` hardware type, along with related interfaces to support
to support OneView, have been deprecated, and should be expected to be OneView, have been deprecated, and should be expected to be
removed from ironic in the Stein cycle. Please see removed from ironic in the Stein cycle. Please see
`storyboard <https://storyboard.openstack.org/#!/story/2001924>`_ for `storyboard <https://storyboard.openstack.org/#!/story/2001924>`_ for
additional details. additional details.
@ -21,30 +21,14 @@ instance. In this context, the ``HP OneView driver`` for ironic enables the
users of OneView to use ironic as a bare metal provider to their managed users of OneView to use ironic as a bare metal provider to their managed
physical hardware. physical hardware.
HPE OneView hardware is supported by the ``oneview`` hardware type and the HPE OneView hardware is supported by the ``oneview`` hardware type.
following classic drivers:
* ``iscsi_pxe_oneview``
* ``agent_pxe_oneview``
Classic Drivers
===============
The ``iscsi_pxe_oneview`` and ``agent_pxe_oneview`` drivers implement the core
interfaces of an ironic Driver [2]_, and use the ``hpOneView`` [3]_ library
to provide communication between ironic and OneView through OneView's REST API.
.. note::
Classic drivers will be deprecated in favor of Hardware Types.
To provide a bare metal instance there are four components involved in the To provide a bare metal instance there are four components involved in the
process: process:
* The ironic service * The ironic service
* The ironic-inspector service (if using hardware inspection) * The ironic-inspector service (if using hardware inspection)
* The ironic driver for OneView, which can be: * The ironic hardware type for OneView
* `iscsi_pxe_oneview` or
* `agent_pxe_oneview`
* The hpOneView library * The hpOneView library
* The OneView appliance * The OneView appliance
@ -70,9 +54,6 @@ the node is no longer in use, these tasks will make place them back in
Prerequisites Prerequisites
============= =============
The following requirements apply for both ``iscsi_pxe_oneview`` and
``agent_pxe_oneview`` drivers:
* ``OneView appliance`` is the HP physical infrastructure manager to be * ``OneView appliance`` is the HP physical infrastructure manager to be
integrated with the OneView drivers. integrated with the OneView drivers.
@ -216,49 +197,11 @@ hardware type:
--driver oneview \ --driver oneview \
--deploy-interface oneview-iscsi --deploy-interface oneview-iscsi
Deploy process with oneview-iscsi deploy interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drivers 1. Admin configures the Proliant baremetal node to use ``oneview-iscsi``
======= deploy interface.
iscsi_pxe_oneview driver
^^^^^^^^^^^^^^^^^^^^^^^^
Overview
~~~~~~~~
``iscsi_pxe_oneview`` driver uses PXEBoot for boot and ISCSIDeploy for deploy.
Configuring and enabling the driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Add ``iscsi_pxe_oneview`` to the list of ``enabled_drivers`` in your
``ironic.conf`` file. For example::
enabled_drivers = iscsi_pxe_oneview
2. Update the [oneview] section of your ``ironic.conf`` file with your
OneView credentials and CA certificate files information.
.. note::
An operator can set the ``periodic_check_interval`` option in the [oneview]
section to set the interval between running the periodic check. The default
value is 300 seconds (5 minutes). A lower value will reduce the likelihood
of races between ironic and OneView at the cost of being more resource
intensive.
3. Restart the ironic conductor service. For Ubuntu users, do::
$ sudo service ironic-conductor restart
See :doc:`/install/index` for more information.
Deploy process
~~~~~~~~~~~~~~
Here is an overview of the deploy process for this driver:
1. Admin configures the Proliant baremetal node to use ``iscsi_pxe_oneview``
driver.
2. ironic gets a request to deploy a Glance image on the baremetal node. 2. ironic gets a request to deploy a Glance image on the baremetal node.
3. Driver sets the boot device to PXE. 3. Driver sets the boot device to PXE.
4. Driver powers on the baremetal node. 4. Driver powers on the baremetal node.
@ -270,45 +213,11 @@ Here is an overview of the deploy process for this driver:
10. Driver powers on the machine. 10. Driver powers on the machine.
11. Baremetal node is active and ready to be used. 11. Baremetal node is active and ready to be used.
agent_pxe_oneview driver Deploy process with oneview-direct deploy interface
^^^^^^^^^^^^^^^^^^^^^^^^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Overview 1. Admin configures the Proliant baremetal node to use ``oneview-direct``
~~~~~~~~ deploy interface.
``agent_pxe_oneview`` driver uses PXEBoot for boot and AgentDeploy for deploy.
Configuring and enabling the driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Add ``agent_pxe_oneview`` to the list of ``enabled_drivers`` in your
``ironic.conf``. For example::
enabled_drivers = pxe_ipmitool,agent_pxe_oneview
2. Update the [oneview] section of your ``ironic.conf`` file with your
OneView credentials and CA certificate files information.
.. note::
An operator can set the ``periodic_check_interval`` option in the [oneview]
section to set the interval between running the periodic check. The default
value is 300 seconds (5 minutes). A lower value will reduce the likelihood
of races between ironic and OneView at the cost of being more resource
intensive.
3. Restart the ironic conductor service. For Ubuntu users, do::
$ service ironic-conductor restart
See :doc:`/install/index` for more information.
Deploy process
~~~~~~~~~~~~~~
Here is an overview of the deploy process for this driver:
1. Admin configures the Proliant baremetal node to use ``agent_pxe_oneview``
driver.
2. ironic gets a request to deploy a Glance image on the baremetal node. 2. ironic gets a request to deploy a Glance image on the baremetal node.
3. Driver sets the boot device to PXE. 3. Driver sets the boot device to PXE.
4. Driver powers on the baremetal node. 4. Driver powers on the baremetal node.
@ -339,8 +248,8 @@ Registering a OneView node in ironic
==================================== ====================================
Nodes configured to use any of the OneView drivers should have the ``driver`` Nodes configured to use any of the OneView drivers should have the ``driver``
property set to ``iscsi_pxe_oneview`` or ``agent_pxe_oneview``. Considering property set to ``oneview``. Considering our context, a node is the
our context, a node is the representation of a ``Server Hardware`` in OneView, representation of a ``Server Hardware`` in OneView,
and should be consistent with all its properties and related components, such and should be consistent with all its properties and related components, such
as ``Server Hardware Type``, ``Server Profile Template``, ``Enclosure Group``, as ``Server Hardware Type``, ``Server Profile Template``, ``Enclosure Group``,
etc. In this case, to be enrolled, the node must have the following parameters: etc. In this case, to be enrolled, the node must have the following parameters:
@ -419,7 +328,7 @@ In order to ease user manual tasks, which are often time-consuming, we provide
useful tools that work nicely with the OneView drivers. useful tools that work nicely with the OneView drivers.
ironic-oneview-cli ironic-oneview-cli
^^^^^^^^^^^^^^^^^^ ~~~~~~~~~~~~~~~~~~
The ``ironic-oneView`` CLI is a command line interface for management tasks The ``ironic-oneView`` CLI is a command line interface for management tasks
involving OneView nodes. Its features include a facility to create of ironic involving OneView nodes. Its features include a facility to create of ironic
@ -430,7 +339,7 @@ For more details on how Ironic-OneView CLI works and how to set it up, see
[8]_. [8]_.
ironic-oneviewd ironic-oneviewd
^^^^^^^^^^^^^^^ ~~~~~~~~~~~~~~~
The ``ironic-oneviewd`` daemon monitors the ironic inventory of resources and The ``ironic-oneviewd`` daemon monitors the ironic inventory of resources and
provides facilities to operators managing OneView driver deployments. provides facilities to operators managing OneView driver deployments.
@ -440,8 +349,6 @@ For more details on how Ironic-OneViewd works and how to set it up, see [7]_.
References References
========== ==========
.. [1] HP OneView - https://www.hpe.com/us/en/integrated-systems/software.html .. [1] HP OneView - https://www.hpe.com/us/en/integrated-systems/software.html
.. [2] :ref:`architecture_drivers`
.. [3] hpOneView - https://pypi.org/project/hpOneView
.. [6] Dynamic Allocation in OneView drivers - https://specs.openstack.org/openstack/ironic-specs/specs/not-implemented/oneview-drivers-dynamic-allocation.html .. [6] Dynamic Allocation in OneView drivers - https://specs.openstack.org/openstack/ironic-specs/specs/not-implemented/oneview-drivers-dynamic-allocation.html
.. [7] ironic-oneviewd - https://pypi.org/project/ironic-oneviewd/ .. [7] ironic-oneviewd - https://pypi.org/project/ironic-oneviewd/
.. [8] ironic-oneview-cli - https://pypi.org/project/ironic-oneview-cli/ .. [8] ironic-oneview-cli - https://pypi.org/project/ironic-oneview-cli/

View File

@ -57,9 +57,6 @@ COMMON_PROPERTIES.update(REQUIRED_ON_DRIVER_INFO)
COMMON_PROPERTIES.update(REQUIRED_ON_PROPERTIES) COMMON_PROPERTIES.update(REQUIRED_ON_PROPERTIES)
COMMON_PROPERTIES.update(OPTIONAL_ON_PROPERTIES) COMMON_PROPERTIES.update(OPTIONAL_ON_PROPERTIES)
ISCSI_PXE_ONEVIEW = 'iscsi_pxe_oneview'
AGENT_PXE_ONEVIEW = 'agent_pxe_oneview'
# NOTE(xavierr): We don't want to translate NODE_IN_USE_BY_ONEVIEW and # NOTE(xavierr): We don't want to translate NODE_IN_USE_BY_ONEVIEW and
# SERVER_HARDWARE_ALLOCATION_ERROR to avoid inconsistency in the nodes # SERVER_HARDWARE_ALLOCATION_ERROR to avoid inconsistency in the nodes
# caused by updates on translation in upgrades of ironic. # caused by updates on translation in upgrades of ironic.

View File

@ -36,10 +36,6 @@ METRICS = metrics_utils.get_metrics_logger(__name__)
@six.add_metaclass(abc.ABCMeta) @six.add_metaclass(abc.ABCMeta)
class OneViewPeriodicTasks(object): class OneViewPeriodicTasks(object):
@abc.abstractproperty
def oneview_driver(self):
pass
@periodics.periodic(spacing=CONF.oneview.periodic_check_interval, @periodics.periodic(spacing=CONF.oneview.periodic_check_interval,
enabled=CONF.oneview.enable_periodic_tasks) enabled=CONF.oneview.enable_periodic_tasks)
def _periodic_check_nodes_taken_by_oneview(self, manager, context): def _periodic_check_nodes_taken_by_oneview(self, manager, context):
@ -58,7 +54,7 @@ class OneViewPeriodicTasks(object):
filters = { filters = {
'provision_state': states.AVAILABLE, 'provision_state': states.AVAILABLE,
'maintenance': False, 'maintenance': False,
'driver': self.oneview_driver 'driver': 'oneview'
} }
node_iter = manager.iter_nodes(filters=filters) node_iter = manager.iter_nodes(filters=filters)
@ -116,7 +112,7 @@ class OneViewPeriodicTasks(object):
filters = { filters = {
'provision_state': states.MANAGEABLE, 'provision_state': states.MANAGEABLE,
'maintenance': True, 'maintenance': True,
'driver': self.oneview_driver 'driver': 'oneview'
} }
node_iter = manager.iter_nodes(fields=['maintenance_reason'], node_iter = manager.iter_nodes(fields=['maintenance_reason'],
filters=filters) filters=filters)
@ -182,7 +178,7 @@ class OneViewPeriodicTasks(object):
filters = { filters = {
'provision_state': states.CLEANFAIL, 'provision_state': states.CLEANFAIL,
'driver': self.oneview_driver 'driver': 'oneview'
} }
node_iter = manager.iter_nodes(fields=['driver_internal_info'], node_iter = manager.iter_nodes(fields=['driver_internal_info'],
filters=filters) filters=filters)
@ -224,8 +220,6 @@ class OneViewIscsiDeploy(iscsi_deploy.ISCSIDeploy, OneViewPeriodicTasks):
# TODO(TheJulia): This should be expected to be removed in Stein. # TODO(TheJulia): This should be expected to be removed in Stein.
supported = False supported = False
oneview_driver = common.ISCSI_PXE_ONEVIEW
def get_properties(self): def get_properties(self):
return deploy_utils.get_properties() return deploy_utils.get_properties()
@ -270,8 +264,6 @@ class OneViewAgentDeploy(agent.AgentDeploy, OneViewPeriodicTasks):
# TODO(TheJulia): This should be expected to be removed in Stein. # TODO(TheJulia): This should be expected to be removed in Stein.
supported = False supported = False
oneview_driver = common.AGENT_PXE_ONEVIEW
def get_properties(self): def get_properties(self):
return deploy_utils.get_properties() return deploy_utils.get_properties()

View File

@ -73,20 +73,19 @@ class OneViewInspect(inspector.Inspector):
@periodics.periodic(spacing=CONF.inspector.status_check_period, @periodics.periodic(spacing=CONF.inspector.status_check_period,
enabled=CONF.inspector.enabled) enabled=CONF.inspector.enabled)
def _periodic_check_result(self, manager, context): def _periodic_check_result(self, manager, context):
filters = {'provision_state': states.INSPECTWAIT} filters = {'provision_state': states.INSPECTWAIT,
'driver': 'oneview'}
node_iter = manager.iter_nodes(filters=filters) node_iter = manager.iter_nodes(filters=filters)
for node_uuid, driver in node_iter: for node_uuid, driver in node_iter:
if driver in [common.AGENT_PXE_ONEVIEW, try:
common.ISCSI_PXE_ONEVIEW]: lock_purpose = 'checking hardware inspection status'
try: with task_manager.acquire(context, node_uuid,
lock_purpose = 'checking hardware inspection status' shared=True,
with task_manager.acquire(context, node_uuid, purpose=lock_purpose) as task:
shared=True, self._check_status(task)
purpose=lock_purpose) as task: except (exception.NodeLocked, exception.NodeNotFound):
self._check_status(task) continue
except (exception.NodeLocked, exception.NodeNotFound):
continue
def _check_status(self, task): def _check_status(self, task):
state_before = task.node.provision_state state_before = task.node.provision_state

View File

@ -14,25 +14,15 @@
# under the License. # under the License.
""" """
OneView Driver and supporting meta-classes. OneView hardware type.
""" """
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 generic from ironic.drivers import generic
from ironic.drivers.modules import noop from ironic.drivers.modules import noop
from ironic.drivers.modules.oneview import deploy from ironic.drivers.modules.oneview import deploy
from ironic.drivers.modules.oneview import inspect from ironic.drivers.modules.oneview import inspect
from ironic.drivers.modules.oneview import management from ironic.drivers.modules.oneview import management
from ironic.drivers.modules.oneview import power from ironic.drivers.modules.oneview import power
from ironic.drivers.modules import pxe
CONF = cfg.CONF
class OneViewHardware(generic.GenericHardware): class OneViewHardware(generic.GenericHardware):
@ -66,101 +56,3 @@ class OneViewHardware(generic.GenericHardware):
def supported_power_interfaces(self): def supported_power_interfaces(self):
"""List of supported power interfaces.""" """List of supported power interfaces."""
return [power.OneViewPower] return [power.OneViewPower]
class AgentPXEOneViewDriver(base.BaseDriver):
"""OneViewDriver using OneViewClient interface.
This driver implements the `core` functionality using
:class:ironic.drivers.modules.oneview.power.OneViewPower for power
management. And
:class:ironic.drivers.modules.oneview.deploy.OneViewAgentDeploy for deploy.
"""
# NOTE(TheJulia): Marking as unsupported as 3rd party CI was taken down
# shortly before the beginning of the Rocky cycle, and no replies have
# indicated that 3rd party CI will be re-established nor visible
# actions observed regarding re-establishing 3rd party CI.
# TODO(TheJulia): This should be expected to be removed in Stein.
supported = False
def __init__(self):
if not importutils.try_import('hpOneView.oneview_client'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import hpOneView library"))
if not importutils.try_import('redfish'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import python-ilorest-library"))
self.power = power.OneViewPower()
self.management = management.OneViewManagement()
self.boot = pxe.PXEBoot()
self.deploy = deploy.OneViewAgentDeploy()
self.inspect = inspect.OneViewInspect.create_if_enabled(
'AgentPXEOneViewDriver')
@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 = 'oneview'
else:
inspect_interface = 'no-inspect'
return 'oneview', {'boot': 'pxe',
'deploy': 'oneview-direct',
'inspect': inspect_interface,
'management': 'oneview',
'power': 'oneview'}
class ISCSIPXEOneViewDriver(base.BaseDriver):
"""OneViewDriver using OneViewClient interface.
This driver implements the `core` functionality using
:class:ironic.drivers.modules.oneview.power.OneViewPower for power
management. And
:class:ironic.drivers.modules.oneview.deploy.OneViewIscsiDeploy for deploy.
"""
# NOTE(TheJulia): Marking as unsupported as 3rd party CI was taken down
# shortly before the beginning of the Rocky cycle, and no replies have
# indicated that 3rd party CI will be re-established nor visible
# actions observed regarding re-establishing 3rd party CI.
# TODO(TheJulia): This should be expected to be removed in Stein.
supported = False
def __init__(self):
if not importutils.try_import('hpOneView.oneview_client'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import hpOneView library"))
if not importutils.try_import('redfish'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import python-ilorest-library"))
self.power = power.OneViewPower()
self.management = management.OneViewManagement()
self.boot = pxe.PXEBoot()
self.deploy = deploy.OneViewIscsiDeploy()
self.inspect = inspect.OneViewInspect.create_if_enabled(
'ISCSIPXEOneViewDriver')
@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 = 'oneview'
else:
inspect_interface = 'no-inspect'
return 'oneview', {'boot': 'pxe',
'deploy': 'oneview-iscsi',
'inspect': inspect_interface,
'management': 'oneview',
'power': 'oneview'}

View File

@ -28,6 +28,8 @@ hponeview_client = importutils.try_import('hpOneView.oneview_client')
class BaseOneViewTest(db_base.DbTestCase): class BaseOneViewTest(db_base.DbTestCase):
deploy_interface = None
def setUp(self): def setUp(self):
super(BaseOneViewTest, self).setUp() super(BaseOneViewTest, self).setUp()
self.config(enabled_hardware_types=['oneview', 'fake-hardware'], self.config(enabled_hardware_types=['oneview', 'fake-hardware'],
@ -39,6 +41,7 @@ class BaseOneViewTest(db_base.DbTestCase):
enabled_power_interfaces=['oneview', 'fake']) enabled_power_interfaces=['oneview', 'fake'])
self.node = obj_utils.create_test_node( self.node = obj_utils.create_test_node(
self.context, driver='oneview', self.context, driver='oneview',
deploy_interface=self.deploy_interface,
properties=db_utils.get_test_oneview_properties(), properties=db_utils.get_test_oneview_properties(),
driver_info=db_utils.get_test_oneview_driver_info(), driver_info=db_utils.get_test_oneview_driver_info(),
) )

View File

@ -15,7 +15,6 @@
import mock import mock
from ironic.common import driver_factory
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states
from ironic.conductor import task_manager from ironic.conductor import task_manager
@ -25,14 +24,10 @@ from ironic.drivers.modules import iscsi_deploy
from ironic.drivers.modules.oneview import common from ironic.drivers.modules.oneview import common
from ironic.drivers.modules.oneview import deploy from ironic.drivers.modules.oneview import deploy
from ironic.drivers.modules.oneview import deploy_utils from ironic.drivers.modules.oneview import deploy_utils
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.db import utils as db_utils
from ironic.tests.unit.drivers.modules.oneview import test_common from ironic.tests.unit.drivers.modules.oneview import test_common
from ironic.tests.unit.objects import utils as obj_utils from ironic.tests.unit.objects import utils as obj_utils
METHODS = ['iter_nodes', 'update_node', 'do_provisioning_action'] METHODS = ['iter_nodes', 'update_node', 'do_provisioning_action']
PXE_DRV_INFO_DICT = db_utils.get_test_pxe_driver_info()
PXE_INST_INFO_DICT = db_utils.get_test_pxe_instance_info()
oneview_error = common.SERVER_HARDWARE_ALLOCATION_ERROR oneview_error = common.SERVER_HARDWARE_ALLOCATION_ERROR
maintenance_reason = common.NODE_IN_USE_BY_ONEVIEW maintenance_reason = common.NODE_IN_USE_BY_ONEVIEW
@ -232,7 +227,9 @@ class OneViewPeriodicTasks(test_common.BaseOneViewTest):
self.assertNotIn('oneview_error', self.node.driver_internal_info) self.assertNotIn('oneview_error', self.node.driver_internal_info)
class OneViewIscsiDeployTestCase(db_base.DbTestCase): class OneViewIscsiDeployTestCase(test_common.BaseOneViewTest):
deploy_interface = 'oneview-iscsi'
def setUp(self): def setUp(self):
super(OneViewIscsiDeployTestCase, self).setUp() super(OneViewIscsiDeployTestCase, self).setUp()
@ -240,24 +237,14 @@ class OneViewIscsiDeployTestCase(db_base.DbTestCase):
self.config(username='user', group='oneview') self.config(username='user', group='oneview')
self.config(password='password', group='oneview') self.config(password='password', group='oneview')
self.config(enabled_drivers=['iscsi_pxe_oneview'])
self.driver = driver_factory.get_driver('iscsi_pxe_oneview')
OV_DRV_INFO_DICT = db_utils.get_test_oneview_driver_info()
OV_DRV_INFO_DICT.update(PXE_DRV_INFO_DICT)
self.node = obj_utils.create_test_node(
self.context, driver='iscsi_pxe_oneview',
properties=db_utils.get_test_oneview_properties(),
driver_info=OV_DRV_INFO_DICT,
instance_info=PXE_INST_INFO_DICT,
)
self.port = obj_utils.create_test_port(self.context, self.port = obj_utils.create_test_port(self.context,
node_id=self.node.id) node_id=self.node.id)
self.info = common.get_oneview_info(self.node) self.info = common.get_oneview_info(self.node)
def test_get_properties(self): def test_get_properties(self):
expected = common.COMMON_PROPERTIES expected = common.COMMON_PROPERTIES
self.assertEqual(expected, self.driver.deploy.get_properties()) self.assertEqual(expected,
deploy.OneViewIscsiDeploy().get_properties())
@mock.patch.object(common, 'validate_oneview_resources_compatibility', @mock.patch.object(common, 'validate_oneview_resources_compatibility',
spect_set=True, autospec=True) spect_set=True, autospec=True)
@ -360,31 +347,24 @@ class OneViewIscsiDeployTestCase(db_base.DbTestCase):
self.assertTrue(deallocate_server_hardware_mock.called) self.assertTrue(deallocate_server_hardware_mock.called)
class OneViewAgentDeployTestCase(db_base.DbTestCase): class OneViewAgentDeployTestCase(test_common.BaseOneViewTest):
deploy_interface = 'oneview-direct'
def setUp(self): def setUp(self):
super(OneViewAgentDeployTestCase, self).setUp() super(OneViewAgentDeployTestCase, self).setUp()
self.config(manager_url='https://1.2.3.4', group='oneview') self.config(manager_url='https://1.2.3.4', group='oneview')
self.config(username='user', group='oneview') self.config(username='user', group='oneview')
self.config(password='password', group='oneview') self.config(password='password', group='oneview')
self.config(enabled_drivers=['agent_pxe_oneview'])
self.driver = driver_factory.get_driver('agent_pxe_oneview')
OV_DRV_INFO_DICT = db_utils.get_test_oneview_driver_info()
OV_DRV_INFO_DICT.update(PXE_DRV_INFO_DICT)
self.node = obj_utils.create_test_node(
self.context, driver='agent_pxe_oneview',
properties=db_utils.get_test_oneview_properties(),
driver_info=OV_DRV_INFO_DICT,
instance_info=PXE_INST_INFO_DICT,
)
self.port = obj_utils.create_test_port(self.context, self.port = obj_utils.create_test_port(self.context,
node_id=self.node.id) node_id=self.node.id)
self.info = common.get_oneview_info(self.node) self.info = common.get_oneview_info(self.node)
def test_get_properties(self): def test_get_properties(self):
expected = common.COMMON_PROPERTIES expected = common.COMMON_PROPERTIES
self.assertEqual(expected, self.driver.deploy.get_properties()) self.assertEqual(expected,
deploy.OneViewAgentDeploy().get_properties())
@mock.patch.object(common, 'validate_oneview_resources_compatibility', @mock.patch.object(common, 'validate_oneview_resources_compatibility',
spect_set=True, autospec=True) spect_set=True, autospec=True)

View File

@ -18,59 +18,15 @@ import mock
from ironic.conductor import task_manager from ironic.conductor import task_manager
from ironic.drivers.modules.oneview import common as ov_common from ironic.drivers.modules.oneview import common as ov_common
from ironic.drivers.modules.oneview import deploy_utils from ironic.drivers.modules.oneview import deploy_utils
from ironic.tests.unit.db import base as db_base from ironic.tests.unit.drivers.modules.oneview import test_common
from ironic.tests.unit.db import utils as db_utils
from ironic.tests.unit.objects import utils as obj_utils
class AgentPXEOneViewInspectTestCase(db_base.DbTestCase): class OneViewInspectTestCase(test_common.BaseOneViewTest):
def setUp(self): def setUp(self):
super(AgentPXEOneViewInspectTestCase, self).setUp() super(OneViewInspectTestCase, self).setUp()
self.config(enabled=True, group='inspector') self.config(enabled=True, group='inspector')
self.config(manager_url='https://1.2.3.4', group='oneview') self.config(manager_url='https://1.2.3.4', group='oneview')
self.config(enabled_drivers=['agent_pxe_oneview'])
self.node = obj_utils.create_test_node(
self.context, driver='agent_pxe_oneview',
properties=db_utils.get_test_oneview_properties(),
driver_info=db_utils.get_test_oneview_driver_info(),
)
def test_get_properties(self):
expected = deploy_utils.get_properties()
with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task:
self.assertEqual(expected, task.driver.inspect.get_properties())
@mock.patch.object(ov_common, 'validate_oneview_resources_compatibility',
autospect=True)
def test_validate(self, mock_validate):
with task_manager.acquire(self.context, self.node.uuid,
shared=False) as task:
task.driver.inspect.validate(task)
self.assertTrue(mock_validate.called)
@mock.patch.object(deploy_utils, 'allocate_server_hardware_to_ironic',
autospect=True)
def test_inspect_hardware(self, mock_allocate_server_hardware_to_ironic):
with task_manager.acquire(self.context, self.node.uuid,
shared=False) as task:
task.driver.inspect.inspect_hardware(task)
self.assertTrue(mock_allocate_server_hardware_to_ironic.called)
class ISCSIPXEOneViewInspectTestCase(db_base.DbTestCase):
def setUp(self):
super(ISCSIPXEOneViewInspectTestCase, self).setUp()
self.config(enabled=True, group='inspector')
self.config(manager_url='https://1.2.3.4', group='oneview')
self.config(enabled_drivers=['iscsi_pxe_oneview'])
self.node = obj_utils.create_test_node(
self.context, driver='iscsi_pxe_oneview',
properties=db_utils.get_test_oneview_properties(),
driver_info=db_utils.get_test_oneview_driver_info(),
)
def test_get_properties(self): def test_get_properties(self):
expected = deploy_utils.get_properties() expected = deploy_utils.get_properties()

View File

@ -15,16 +15,9 @@
"""Test class for HPE OneView Drivers.""" """Test class for HPE OneView Drivers."""
import mock
import testtools
from ironic.common import exception
from ironic.conductor import task_manager from ironic.conductor import task_manager
from ironic.drivers.modules import agent from ironic.drivers.modules import agent
from ironic.drivers.modules import noop from ironic.drivers.modules import noop
from ironic.drivers.modules.oneview import deploy
from ironic.drivers.modules.oneview import management
from ironic.drivers.modules.oneview import power
from ironic.drivers.modules import pxe from ironic.drivers.modules import pxe
from ironic.drivers.modules.storage import noop as noop_storage from ironic.drivers.modules.storage import noop as noop_storage
from ironic.drivers import oneview from ironic.drivers import oneview
@ -131,42 +124,3 @@ class OneViewHardwareTestCase(db_base.DbTestCase):
oneview.power.OneViewPower) oneview.power.OneViewPower)
self.assertIsInstance(task.driver.raid, self.assertIsInstance(task.driver.raid,
agent.AgentRAID) agent.AgentRAID)
@mock.patch.object(oneview.importutils, 'try_import', autospec=True)
class AgentPXEOneViewDriversTestCase(testtools.TestCase):
def test_oneview_agent_driver(self, mock_try_import):
mock_try_import.return_value = True
driver = oneview.AgentPXEOneViewDriver()
self.assertIsInstance(driver.boot, pxe.PXEBoot)
self.assertIsInstance(driver.power, power.OneViewPower)
self.assertIsInstance(driver.deploy, deploy.OneViewAgentDeploy)
self.assertIsInstance(driver.management, management.OneViewManagement)
def test_oneview_agent_driver_exc(self, mock_try_import):
mock_try_import.return_value = None
self.assertRaises(exception.DriverLoadError,
oneview.AgentPXEOneViewDriver)
@mock.patch.object(oneview.importutils, 'try_import', autospec=True)
class ISCSIPXEOneViewDriversTestCase(testtools.TestCase):
def test_oneview_iscsi_driver(self, mock_try_import):
mock_try_import.return_value = True
driver = oneview.ISCSIPXEOneViewDriver()
self.assertIsInstance(driver.boot, pxe.PXEBoot)
self.assertIsInstance(driver.power, power.OneViewPower)
self.assertIsInstance(driver.deploy, deploy.OneViewIscsiDeploy)
self.assertIsInstance(driver.management, management.OneViewManagement)
def test_oneview_iscsi_driver_exc(self, mock_try_import):
mock_try_import.return_value = None
self.assertRaises(exception.DriverLoadError,
oneview.ISCSIPXEOneViewDriver)

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
The deprecated classic drivers ``iscsi_pxe_oneview`` and
``agent_pxe_oneview`` have been removed. Please use the ``oneview``
hardware type.

View File

@ -56,9 +56,7 @@ ironic.drivers =
agent_ipmitool = ironic.drivers.ipmi:AgentAndIPMIToolDriver agent_ipmitool = ironic.drivers.ipmi:AgentAndIPMIToolDriver
agent_ipmitool_socat = ironic.drivers.ipmi:AgentAndIPMIToolAndSocatDriver agent_ipmitool_socat = ironic.drivers.ipmi:AgentAndIPMIToolAndSocatDriver
agent_irmc = ironic.drivers.irmc:IRMCVirtualMediaAgentDriver agent_irmc = ironic.drivers.irmc:IRMCVirtualMediaAgentDriver
agent_pxe_oneview = ironic.drivers.oneview:AgentPXEOneViewDriver
iscsi_irmc = ironic.drivers.irmc:IRMCVirtualMediaIscsiDriver iscsi_irmc = ironic.drivers.irmc:IRMCVirtualMediaIscsiDriver
iscsi_pxe_oneview = ironic.drivers.oneview:ISCSIPXEOneViewDriver
pxe_ipmitool = ironic.drivers.ipmi:PXEAndIPMIToolDriver pxe_ipmitool = ironic.drivers.ipmi:PXEAndIPMIToolDriver
pxe_ipmitool_socat = ironic.drivers.ipmi:PXEAndIPMIToolAndSocatDriver pxe_ipmitool_socat = ironic.drivers.ipmi:PXEAndIPMIToolAndSocatDriver
pxe_irmc = ironic.drivers.pxe:PXEAndIRMCDriver pxe_irmc = ironic.drivers.pxe:PXEAndIRMCDriver