Prevent Active-Active on drivers by default

Active-Active configurations are not trivial, and therefore vendors need
to check that their drivers support these configurations and have no
issues.

Since users will most likely assume that once Active-Active is available
as a core functionality all drivers will be supporting it this could
lead to data loss, data corruption, or just bad user experience.

In order to prevent this, without a full Active-Active test suite, we
will rely on vendor "auto certification".

What this means is that Cinder won't allow any driver to start in an
Active-Active configuration by default until the vendor has tested their
driver's readiness and explicitly set in the code.

Vendors will set SUPPORTS_ACTIVE_ACTIVE class attribute to True in their
drivers to reflect the driver's readiness, or if the readiness depends
on some configuration options they can leave the class attribute with
the default False value and just set it as an instance attribute in
their __init__ method.

Implements: blueprint cinder-volume-active-active-support
Change-Id: I6034be3e96f85e8995e34b6420fbdb5570538f1c
This commit is contained in:
Gorka Eguileor 2016-11-03 20:20:14 +01:00
parent f2431b5d24
commit 384cb34868
2 changed files with 14 additions and 0 deletions

View File

@ -322,6 +322,13 @@ class BaseVD(object):
"""
VERSION = "N/A"
# NOTE(geguileo): By default we assume drivers don't support Active-Active
# configurations. If driver supports it then they can set this class
# attribute on the driver, and if support depends on configuration options
# then they can set it at the instance level on the driver's __init__
# method since the manager will do the check after that.
SUPPORTS_ACTIVE_ACTIVE = False
def __init__(self, execute=utils.execute, *args, **kwargs):
# NOTE(vish): db is set by Manager
self.db = kwargs.get('db')

View File

@ -224,6 +224,13 @@ class VolumeManager(manager.CleanableManager,
host=self.host,
is_vol_db_empty=vol_db_empty,
active_backend_id=curr_active_backend_id)
if self.cluster and not self.driver.SUPPORTS_ACTIVE_ACTIVE:
msg = _LE('Active-Active configuration is not currently supported '
'by driver %s.') % volume_driver
LOG.error(msg)
raise exception.VolumeDriverException(message=msg)
self.message_api = message_api.API()
if CONF.profiler.enabled and profiler is not None: