Deprecate the Direct Engine
Add deprecation warning at sahara startup and during each cluster operation with direct engine. Also add documentation about direct engine deprecation. Implements blueprint: deprecate-direct-engine Change-Id: Ic478918834d3627557b0ba43873e37d9e6ff7dc9
This commit is contained in:
parent
29488d6e1f
commit
101f51388b
@ -195,23 +195,25 @@ in the ``[oslo_messaging_qpid]`` section:
|
||||
Orchestration configuration
|
||||
---------------------------
|
||||
|
||||
By default sahara is configured to use the direct engine for instance
|
||||
creation. This engine makes calls directly to the services required
|
||||
for instance provisioning. Sahara can be configured to use the OpenStack
|
||||
Orchestration service for this task instead of the direct engine.
|
||||
By default sahara is configured to use the heat engine for instance
|
||||
creation. The heat engine uses the Openstack Orchestration service to
|
||||
provision instances. Sahara can be configured to use the direct engine for
|
||||
this purpose, but after the Liberty release it will be removed. This
|
||||
engine makes calls directly to the services required for instance
|
||||
provisioning. We recommend using the Openstack Orchestration service.
|
||||
|
||||
To configure sahara to utilize the Orchestration service for instance
|
||||
To configure sahara to use the direct engine for instance
|
||||
provisioning the ``infrastructure_engine`` parameter should be modified in
|
||||
the configuration file as follows:
|
||||
|
||||
.. sourcecode:: cfg
|
||||
|
||||
[DEFAULT]
|
||||
infrastructure_engine=heat
|
||||
infrastructure_engine=direct
|
||||
|
||||
There is feature parity between the direct and heat infrastructure
|
||||
engines. We recommend using the heat engine for provisioning as the
|
||||
direct is planned for deprecation.
|
||||
.. warning::
|
||||
The direct engine will be removed after the Liberty release, we
|
||||
recommend using the heat engine.
|
||||
|
||||
.. _policy-configuration-label:
|
||||
|
||||
|
@ -119,3 +119,17 @@ should be placed in the same directory as the sahara configuration file or
|
||||
specified using the ``policy_file`` parameter. For more details about the
|
||||
policy file please see the
|
||||
:ref:`policy section in the configuration guide <policy-configuration-label>`.
|
||||
|
||||
Kilo -> Liberty
|
||||
---------------
|
||||
|
||||
Direct engine deprecation
|
||||
+++++++++++++++++++++++++
|
||||
|
||||
In the Liberty release the direct infrastructure engine has been deprecated
|
||||
and the heat infrastructure engine is now default. This means, that it is preferable
|
||||
to use heat engine instead now. In the Liberty release you can continue to
|
||||
operate clusters with the direct engine (create, delete, scale). Using heat engine only
|
||||
the delete operation is available on clusters that were created by the direct engine.
|
||||
After the Liberty release the direct engine will be removed, this means that you will
|
||||
only be able to delete clusters created with the direct engine.
|
||||
|
@ -31,6 +31,7 @@ from sahara.api import v11 as api_v11
|
||||
from sahara import config
|
||||
from sahara import context
|
||||
from sahara.i18n import _LI
|
||||
from sahara.i18n import _LW
|
||||
from sahara.openstack.common import systemd
|
||||
from sahara.plugins import base as plugins_base
|
||||
from sahara.service import api as service_api
|
||||
@ -50,7 +51,7 @@ opts = [
|
||||
cfg.StrOpt('os_region_name',
|
||||
help='Region name used to get services endpoints.'),
|
||||
cfg.StrOpt('infrastructure_engine',
|
||||
default='direct',
|
||||
default='heat',
|
||||
help='An engine which will be used to provision '
|
||||
'infrastructure for Hadoop cluster.'),
|
||||
cfg.StrOpt('remote',
|
||||
@ -179,6 +180,11 @@ def _get_infrastructure_engine():
|
||||
LOG.debug("Infrastructure engine {engine} is loading".format(
|
||||
engine=CONF.infrastructure_engine))
|
||||
|
||||
if CONF.infrastructure_engine == "direct":
|
||||
LOG.warning(_LW("Direct infrastructure engine is deprecated in Liberty"
|
||||
" release and will be removed after that release."
|
||||
" Use Heat infrastructure engine instead."))
|
||||
|
||||
return _load_driver('sahara.infrastructure.engine',
|
||||
CONF.infrastructure_engine)
|
||||
|
||||
|
@ -40,11 +40,18 @@ LOG = logging.getLogger(__name__)
|
||||
SSH_PORT = 22
|
||||
|
||||
|
||||
def _warning_logger():
|
||||
LOG.warning(_LW("Direct infrastructure engine is deprecated in Liberty"
|
||||
" release and will be removed after that release."
|
||||
" Use Heat infrastructure engine instead."))
|
||||
|
||||
|
||||
class DirectEngine(e.Engine):
|
||||
def get_type_and_version(self):
|
||||
return "direct.1.0"
|
||||
|
||||
def create_cluster(self, cluster):
|
||||
_warning_logger()
|
||||
ctx = context.ctx()
|
||||
self._update_rollback_strategy(cluster, shutdown=True)
|
||||
|
||||
@ -75,6 +82,7 @@ class DirectEngine(e.Engine):
|
||||
self._update_rollback_strategy(cluster)
|
||||
|
||||
def scale_cluster(self, cluster, node_group_id_map):
|
||||
_warning_logger()
|
||||
ctx = context.ctx()
|
||||
cluster = g.change_cluster_status(cluster, "Scaling: Spawning")
|
||||
|
||||
@ -110,6 +118,7 @@ class DirectEngine(e.Engine):
|
||||
return instance_ids
|
||||
|
||||
def rollback_cluster(self, cluster, reason):
|
||||
_warning_logger()
|
||||
rollback_info = cluster.rollback_info or {}
|
||||
self._update_rollback_strategy(cluster)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user