Browse Source

Add get_driver_options method

This patch adds a new static method to drivers to expose their
configuration options.  This also adds the same call to backup drivers
as well as the zone manager drivers.
Updated the generate_driver_list to expose the options as well.

This patch also orders the driver list alphabetically to make it easier
and consistent to find drivers.   The driver list is now broken down
into supported and unsupported drivers as well.

Change-Id: I3e7db26ef3df24a12e3bfa219fe25bfb315335ec
changes/55/635255/13
Walter A. Boring IV 3 years ago
parent
commit
fb3b843b66
  1. 4
      cinder/backup/drivers/ceph.py
  2. 4
      cinder/backup/drivers/gcs.py
  3. 4
      cinder/backup/drivers/glusterfs.py
  4. 4
      cinder/backup/drivers/posix.py
  5. 4
      cinder/backup/drivers/swift.py
  6. 4
      cinder/backup/drivers/tsm.py
  7. 1
      cinder/interface/util.py
  8. 4
      cinder/volume/driver.py
  9. 4
      cinder/volume/drivers/datacore/driver.py
  10. 4
      cinder/volume/drivers/dell_emc/powermax/fc.py
  11. 4
      cinder/volume/drivers/dell_emc/powermax/iscsi.py
  12. 4
      cinder/volume/drivers/dell_emc/ps.py
  13. 4
      cinder/volume/drivers/dell_emc/sc/storagecenter_common.py
  14. 8
      cinder/volume/drivers/dell_emc/scaleio/driver.py
  15. 8
      cinder/volume/drivers/dell_emc/unity/driver.py
  16. 4
      cinder/volume/drivers/dell_emc/vnx/driver.py
  17. 4
      cinder/volume/drivers/dell_emc/xtremio.py
  18. 4
      cinder/volume/drivers/drbdmanagedrv.py
  19. 4
      cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_common.py
  20. 4
      cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_fc.py
  21. 4
      cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_iscsi.py
  22. 4
      cinder/volume/drivers/fusionstorage/dsware.py
  23. 9
      cinder/volume/drivers/hedvig/hedvig_cinder.py
  24. 4
      cinder/volume/drivers/hpe/hpe_3par_base.py
  25. 4
      cinder/volume/drivers/hpe/hpe_3par_common.py
  26. 4
      cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py
  27. 4
      cinder/volume/drivers/huawei/common.py
  28. 4
      cinder/volume/drivers/ibm/flashsystem_common.py
  29. 23
      cinder/volume/drivers/ibm/gpfs.py
  30. 4
      cinder/volume/drivers/ibm/ibm_storage/ibm_storage.py
  31. 4
      cinder/volume/drivers/ibm/storwize_svc/storwize_svc_fc.py
  32. 4
      cinder/volume/drivers/ibm/storwize_svc/storwize_svc_iscsi.py
  33. 4
      cinder/volume/drivers/infinidat.py
  34. 4
      cinder/volume/drivers/inspur/as13000/as13000_driver.py
  35. 4
      cinder/volume/drivers/inspur/instorage/instorage_common.py
  36. 4
      cinder/volume/drivers/kaminario/kaminario_common.py
  37. 5
      cinder/volume/drivers/kaminario/kaminario_iscsi.py
  38. 4
      cinder/volume/drivers/lenovo/lenovo_fc.py
  39. 4
      cinder/volume/drivers/lenovo/lenovo_iscsi.py
  40. 4
      cinder/volume/drivers/linstordrv.py
  41. 4
      cinder/volume/drivers/lvm.py
  42. 9
      cinder/volume/drivers/nec/volume.py
  43. 5
      cinder/volume/drivers/netapp/dataontap/fc_cmode.py
  44. 5
      cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py
  45. 5
      cinder/volume/drivers/nexenta/iscsi.py
  46. 14
      cinder/volume/drivers/nexenta/nexentaedge/iscsi.py
  47. 9
      cinder/volume/drivers/nexenta/nfs.py
  48. 9
      cinder/volume/drivers/nexenta/ns5/iscsi.py
  49. 8
      cinder/volume/drivers/nexenta/ns5/nfs.py
  50. 4
      cinder/volume/drivers/nfs.py
  51. 4
      cinder/volume/drivers/nimble.py
  52. 4
      cinder/volume/drivers/prophetstor/dplcommon.py
  53. 4
      cinder/volume/drivers/pure.py
  54. 7
      cinder/volume/drivers/qnap.py
  55. 10
      cinder/volume/drivers/quobyte.py
  56. 4
      cinder/volume/drivers/rbd.py
  57. 4
      cinder/volume/drivers/san/hp/hpmsa_fc.py
  58. 4
      cinder/volume/drivers/san/hp/hpmsa_iscsi.py
  59. 4
      cinder/volume/drivers/sheepdog.py
  60. 4
      cinder/volume/drivers/solidfire.py
  61. 4
      cinder/volume/drivers/spdk.py
  62. 4
      cinder/volume/drivers/storpool.py
  63. 8
      cinder/volume/drivers/synology/synology_iscsi.py
  64. 4
      cinder/volume/drivers/veritas/vrtshyperscale.py
  65. 8
      cinder/volume/drivers/veritas_access/veritas_iscsi.py
  66. 4
      cinder/volume/drivers/vmware/vmdk.py
  67. 8
      cinder/volume/drivers/vzstorage.py
  68. 4
      cinder/volume/drivers/windows/iscsi.py
  69. 4
      cinder/volume/drivers/windows/smbfs.py
  70. 8
      cinder/volume/drivers/zadara.py
  71. 4
      cinder/volume/drivers/zfssa/zfssaiscsi.py
  72. 8
      cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py
  73. 8
      cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py
  74. 63
      tools/generate_driver_list.py

4
cinder/backup/drivers/ceph.py

@ -194,6 +194,10 @@ class CephBackupDriver(driver.BackupDriver):
self._ceph_backup_pool = utils.convert_str(CONF.backup_ceph_pool)
self._ceph_backup_conf = utils.convert_str(CONF.backup_ceph_conf)
@staticmethod
def get_driver_options():
return service_opts
def _validate_string_args(self, *args):
"""Ensure all args are non-None and non-empty."""
return all(args)

4
cinder/backup/drivers/gcs.py

@ -181,6 +181,10 @@ class GoogleBackupDriver(chunkeddriver.ChunkedBackupDriver):
credentials=creds)
self.resumable = self.writer_chunk_size != -1
@staticmethod
def get_driver_options():
return gcsbackup_service_opts
def check_for_setup_error(self):
required_options = ('backup_gcs_bucket', 'backup_gcs_credential_file',
'backup_gcs_project_id')

4
cinder/backup/drivers/glusterfs.py

@ -55,6 +55,10 @@ class GlusterfsBackupDriver(posix.PosixBackupDriver):
super(GlusterfsBackupDriver, self).__init__(context,
backup_path=backup_path)
@staticmethod
def get_driver_options():
return glusterfsbackup_service_opts
def check_for_setup_error(self):
"""Raises error if any required configuration flag is missing."""
required_flags = ['glusterfs_backup_share']

4
cinder/backup/drivers/posix.py

@ -87,6 +87,10 @@ class PosixBackupDriver(chunkeddriver.ChunkedBackupDriver):
raise exception.ConfigNotFound(path='backup_path')
LOG.debug("Using backup repository: %s", self.backup_path)
@staticmethod
def get_driver_options():
return posixbackup_service_opts
def update_container_name(self, backup, container):
if container is not None:
return container

4
cinder/backup/drivers/swift.py

@ -158,6 +158,10 @@ class SwiftBackupDriver(chunkeddriver.ChunkedBackupDriver):
if context:
self.initialize()
@staticmethod
def get_driver_options():
return swiftbackup_service_opts
def initialize(self):
self.swift_attempts = CONF.backup_swift_retry_attempts
self.swift_backoff = CONF.backup_swift_retry_backoff

4
cinder/backup/drivers/tsm.py

@ -270,6 +270,10 @@ class TSMBackupDriver(driver.BackupDriver):
self.tsm_password = CONF.backup_tsm_password
self.volume_prefix = CONF.backup_tsm_volume_prefix
@staticmethod
def get_driver_options():
return tsm_opts
def check_for_setup_error(self):
required_flags = ['backup_share']
for flag in required_flags:

1
cinder/interface/util.py

@ -69,6 +69,7 @@ class DriverInfo(object):
self.version = getattr(cls, 'VERSION', None)
self.ci_wiki_name = getattr(cls, 'CI_WIKI_NAME', None)
self.supported = getattr(cls, 'SUPPORTED', True)
self.driver_options = cls.get_driver_options()
def __str__(self):
return self.class_name

4
cinder/volume/driver.py

@ -562,6 +562,10 @@ class BaseVD(object):
def check_for_setup_error(self):
return
def get_driver_options():
"""Return the oslo_config options specific to the driver."""
return volume_opts
@abc.abstractmethod
def create_volume(self, volume):
"""Creates a volume.

4
cinder/volume/drivers/datacore/driver.py

@ -94,6 +94,10 @@ class DataCoreVolumeDriver(driver.BaseVD):
self._api = None
self._default_volume_options = None
@staticmethod
def get_driver_options():
return datacore_opts
def do_setup(self, context):
"""Perform validations and establish connection to server.

4
cinder/volume/drivers/dell_emc/powermax/fc.py

@ -126,6 +126,10 @@ class PowerMaxFCDriver(san.SanDriver, driver.FibreChannelDriver):
active_backend_id=self.active_backend_id)
self.zonemanager_lookup_service = fczm_utils.create_lookup_service()
@staticmethod
def get_driver_options():
return common.powermax_opts
def check_for_setup_error(self):
pass

4
cinder/volume/drivers/dell_emc/powermax/iscsi.py

@ -131,6 +131,10 @@ class PowerMaxISCSIDriver(san.SanISCSIDriver):
configuration=self.configuration,
active_backend_id=self.active_backend_id))
@staticmethod
def get_driver_options():
return common.powermax_opts
def check_for_setup_error(self):
pass

4
cinder/volume/drivers/dell_emc/ps.py

@ -155,6 +155,10 @@ class PSSeriesISCSIDriver(san.SanISCSIDriver):
self._group_ip = None
self.sshpool = None
@staticmethod
def get_driver_options():
return eqlx_opts
def _get_output(self, chan):
out = ''
ending = '%s> ' % self.configuration.eqlx_group_name

4
cinder/volume/drivers/dell_emc/sc/storagecenter_common.py

@ -110,6 +110,10 @@ class SCCommonDriver(driver.ManageableVD,
self.storage_protocol = 'iSCSI'
self.failback_timeout = 60
@staticmethod
def get_driver_options():
return common_opts
def _bytes_to_gb(self, spacestring):
"""Space is returned in a string like ...

8
cinder/volume/drivers/dell_emc/scaleio/driver.py

@ -145,7 +145,9 @@ SIO_MAX_OVERSUBSCRIPTION_RATIO = 10.0
class ScaleIODriver(driver.VolumeDriver):
"""Cinder ScaleIO Driver
ScaleIO Driver version history:
.. code-block:: none
ScaleIO Driver version history:
2.0.1: Added support for SIO 1.3x in addition to 2.0.x
2.0.2: Added consistency group support to generic volume groups
2.0.3: Added cache for storage pool and protection domains info
@ -232,6 +234,10 @@ class ScaleIODriver(driver.VolumeDriver):
'bandwidthLimit': None,
}
@staticmethod
def get_driver_options():
return scaleio_opts
def check_for_setup_error(self):
# make sure both domain name and id are not specified
if (self.configuration.sio_protection_domain_name

8
cinder/volume/drivers/dell_emc/unity/driver.py

@ -52,7 +52,9 @@ class UnityDriver(driver.ManageableVD,
driver.BaseVD):
"""Unity Driver.
Version history:
.. code-block:: none
Version history:
1.0.0 - Initial version
2.0.0 - Add thin clone support
3.0.0 - Add IPv6 support
@ -79,6 +81,10 @@ class UnityDriver(driver.ManageableVD,
self.protocol = adapter.PROTOCOL_ISCSI
self.adapter = adapter.ISCSIAdapter(self.VERSION)
@staticmethod
def get_driver_options():
return UNITY_OPTS
def do_setup(self, context):
self.adapter.do_setup(self, self.configuration)

4
cinder/volume/drivers/dell_emc/vnx/driver.py

@ -99,6 +99,10 @@ class VNXDriver(driver.ManageableVD,
self.adapter = None
self._stats = {}
@staticmethod
def get_driver_options():
return common.VNX_OPTS
def do_setup(self, context):
if self.protocol == common.PROTOCOL_FC:
self.adapter = adapter.FCAdapter(self.configuration,

4
cinder/volume/drivers/dell_emc/xtremio.py

@ -434,6 +434,10 @@ class XtremIOVolumeDriver(san.SanDriver):
self._stats = {}
self.client = XtremIOClient3(self.configuration, self.cluster_id)
@staticmethod
def get_driver_options():
return XTREMIO_OPTS
def _obj_from_result(self, res):
typ, idx = res['links'][0]['href'].split('/')[-2:]
return self.client.req(typ, idx=int(idx))['content']

4
cinder/volume/drivers/drbdmanagedrv.py

@ -185,6 +185,10 @@ class DrbdManageBaseDriver(driver.VolumeDriver):
CS_DISKLESS = dm_const.CSTATE_PREFIX + dm_const.FLAG_DISKLESS
CS_UPD_CON = dm_const.CSTATE_PREFIX + dm_const.FLAG_UPD_CON
@staticmethod
def get_driver_options():
return drbd_opts
def dbus_connect(self):
self.odm = dbus.SystemBus().get_object(self.drbdmanage_dbus_name,
self.drbdmanage_dbus_interface)

4
cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_common.py

@ -170,6 +170,10 @@ class FJDXCommon(object):
self.configuration.iscsi_ip_address = (
self._get_drvcfg('EternusISCSIIP'))
@staticmethod
def get_driver_options():
return FJ_ETERNUS_DX_OPT_opts
def create_volume(self, volume):
"""Create volume on ETERNUS."""
LOG.debug('create_volume, '

4
cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_fc.py

@ -46,6 +46,10 @@ class FJDXFCDriver(driver.FibreChannelDriver):
configuration=self.configuration)
self.VERSION = self.common.VERSION
@staticmethod
def get_driver_options():
return eternus_dx_common.FJDXCommon.get_driver_options()
def check_for_setup_error(self):
if not self.common.pywbemAvailable:
LOG.error('pywbem could not be imported! '

4
cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_iscsi.py

@ -45,6 +45,10 @@ class FJDXISCSIDriver(driver.ISCSIDriver):
configuration=self.configuration)
self.VERSION = self.common.VERSION
@staticmethod
def get_driver_options():
return eternus_dx_common.FJDXCommon.get_driver_options()
def check_for_setup_error(self):
if not self.common.pywbemAvailable:
LOG.error('pywbem could not be imported! '

4
cinder/volume/drivers/fusionstorage/dsware.py

@ -119,6 +119,10 @@ class DSWAREDriver(driver.VolumeDriver):
self.conf = fs_conf.FusionStorageConf(self.configuration, self.host)
self.client = None
@staticmethod
def get_driver_options():
return volume_opts
def do_setup(self, context):
self.conf.update_config_value()
url_str = self.configuration.san_address

9
cinder/volume/drivers/hedvig/hedvig_cinder.py

@ -40,7 +40,10 @@ LOG = logging.getLogger(__name__)
class HedvigISCSIDriver(driver.ISCSIDriver, san.SanDriver):
"""OpenStack Cinder driver to enable Hedvig storage.
Version history:
.. code-block:: none
Version history:
1.0 - Initial driver
"""
@ -58,6 +61,10 @@ class HedvigISCSIDriver(driver.ISCSIDriver, san.SanDriver):
self.group_stats = {}
self.hrs = None
@staticmethod
def get_driver_options():
return []
def check_for_setup_error(self):
self.hrs.connect()
LOG.info("Initialization complete")

4
cinder/volume/drivers/hpe/hpe_3par_base.py

@ -71,6 +71,10 @@ class HPE3PARDriverBase(driver.ManageableVD,
self.configuration.append_config_values(san.san_opts)
self.protocol = None
@staticmethod
def get_driver_options():
return hpecommon.HPE3PARCommon.get_driver_options()
def _init_common(self):
return hpecommon.HPE3PARCommon(self.configuration,
self._active_backend_id)

4
cinder/volume/drivers/hpe/hpe_3par_common.py

@ -345,6 +345,10 @@ class HPE3PARCommon(object):
def get_version(self):
return self.VERSION
@staticmethod
def get_driver_options():
return hpe3par_opts
def check_flags(self, options, required_flags):
for flag in required_flags:
if not getattr(options, flag, None):

4
cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py

@ -207,6 +207,10 @@ class HPELeftHandISCSIDriver(driver.ISCSIDriver):
self._replication_enabled = False
self._active_backend_id = kwargs.get('active_backend_id', None)
@staticmethod
def get_driver_options():
return hpelefthand_opts
def _login(self, timeout=None):
conf = self._get_lefthand_config()
if conf:

4
cinder/volume/drivers/huawei/common.py

@ -97,6 +97,10 @@ class HuaweiBaseDriver(driver.VolumeDriver):
self.metro_flag = False
self.replica = None
@staticmethod
def get_driver_options():
return huawei_opts
def check_func_support(self, obj_name):
try:
self.client._get_object_count(obj_name)

4
cinder/volume/drivers/ibm/flashsystem_common.py

@ -111,6 +111,10 @@ class FlashSystemDriver(san.SanDriver,
self._vdisk_copy_in_progress = set()
self._vdisk_copy_lock = None
@staticmethod
def get_driver_options():
return flashsystem_opts
def _ssh(self, ssh_cmd, check_exit_code=True):
try:
return self._run_ssh(ssh_cmd, check_exit_code)

23
cinder/volume/drivers/ibm/gpfs.py

@ -147,12 +147,15 @@ class GPFSDriver(driver.CloneableImageVD,
driver.BaseVD):
"""Implements volume functions using GPFS primitives.
Version history:
1.0.0 - Initial driver
1.1.0 - Add volume retype, refactor volume migration
1.2.0 - Add consistency group support
1.3.0 - Add NFS based GPFS storage backend support
1.3.1 - Add GPFS native encryption (encryption of data at rest) support
.. code-block:: none
Version history:
1.0.0 - Initial driver
1.1.0 - Add volume retype, refactor volume migration
1.2.0 - Add consistency group support
1.3.0 - Add NFS based GPFS storage backend support
1.3.1 - Add GPFS native encryption (encryption of data at rest) support
"""
VERSION = "1.3.1"
@ -167,6 +170,10 @@ class GPFSDriver(driver.CloneableImageVD,
self._execute = utils.execute
self.GPFS_PATH = ''
@staticmethod
def get_driver_options():
return gpfs_opts
def _gpfs_local_execute(self, *cmd, **kwargs):
if 'run_as_root' not in kwargs:
kwargs.update({'run_as_root': True})
@ -1409,6 +1416,10 @@ class GPFSRemoteDriver(GPFSDriver, san.SanDriver):
self.gpfs_execute = self._gpfs_remote_execute
self.GPFS_PATH = '/usr/lpp/mmfs/bin/'
@staticmethod
def get_driver_options():
return gpfs_opts + gpfs_remote_ssh_opts
def _gpfs_remote_execute(self, *cmd, **kwargs):
check_exit_code = kwargs.pop('check_exit_code', None)
return self._run_ssh(cmd, check_exit_code)

4
cinder/volume/drivers/ibm/ibm_storage/ibm_storage.py

@ -115,6 +115,10 @@ class IBMStorageDriver(san.SanDriver,
active_backend_id=active_backend_id,
host=self.host)
@staticmethod
def get_driver_options():
return driver_opts
def do_setup(self, context):
"""Setup and verify connection to IBM Storage."""

4
cinder/volume/drivers/ibm/storwize_svc/storwize_svc_fc.py

@ -109,6 +109,10 @@ class StorwizeSVCFCDriver(storwize_common.StorwizeSVCCommonDriver):
self.configuration.append_config_values(
storwize_svc_fc_opts)
@staticmethod
def get_driver_options():
return storwize_common.storwize_svc_opts + storwize_svc_fc_opts
def validate_connector(self, connector):
"""Check connector for at least one enabled FC protocol."""
if 'wwpns' not in connector:

4
cinder/volume/drivers/ibm/storwize_svc/storwize_svc_iscsi.py

@ -109,6 +109,10 @@ class StorwizeSVCISCSIDriver(storwize_common.StorwizeSVCCommonDriver):
self.configuration.append_config_values(
storwize_svc_iscsi_opts)
@staticmethod
def get_driver_options():
return storwize_common.storwize_svc_opts + storwize_svc_iscsi_opts
def validate_connector(self, connector):
"""Check connector for at least one enabled iSCSI protocol."""
if 'initiator' not in connector:

4
cinder/volume/drivers/infinidat.py

@ -132,6 +132,10 @@ class InfiniboxVolumeDriver(san.SanISCSIDriver):
self.configuration.append_config_values(infinidat_opts)
self._lookup_service = fczm_utils.create_lookup_service()
@staticmethod
def get_driver_options():
return infinidat_opts
def _setup_and_get_system_object(self, management_address, auth):
system = infinisdk.InfiniBox(management_address, auth=auth)
system.api.add_auto_retry(

4
cinder/volume/drivers/inspur/as13000/as13000_driver.py

@ -201,6 +201,10 @@ class AS13000Driver(san.SanISCSIDriver):
self.username,
self.password)
@staticmethod
def get_driver_options():
return inspur_as13000_opts
@utils.trace
def do_setup(self, context):
# get tokens for the driver

4
cinder/volume/drivers/inspur/instorage/instorage_common.py

@ -166,6 +166,10 @@ class InStorageMCSCommonDriver(driver.VolumeDriver, san.SanDriver):
# This is used to save the available pools in failed-over status
self._secondary_pools = None
@staticmethod
def get_driver_options():
return instorage_mcs_opts
@cinder_utils.trace
def do_setup(self, ctxt):
"""Check that we have all configuration details from the storage."""

4
cinder/volume/drivers/kaminario/kaminario_common.py

@ -126,6 +126,10 @@ class KaminarioCinderDriver(cinder.volume.driver.ISCSIDriver):
k2_lock_sfx = self.configuration.safe_get('san_ip')
self.k2_lock_name = "%s-%s" % (K2_LOCK_PREFIX, k2_lock_sfx)
@staticmethod
def get_driver_options():
return kaminario_opts
@utils.trace
def check_for_setup_error(self):
if krest is None:

5
cinder/volume/drivers/kaminario/kaminario_iscsi.py

@ -33,7 +33,10 @@ utils.trace = common.utils.trace
class KaminarioISCSIDriver(common.KaminarioCinderDriver):
"""Kaminario K2 iSCSI Volume Driver.
Version history:
.. code-block:: none
Version history:
1.0 - Initial driver
1.1 - Added manage/unmanage and extra-specs support for nodedup
1.2 - Added replication support

4
cinder/volume/drivers/lenovo/lenovo_fc.py

@ -44,5 +44,9 @@ class LenovoFCDriver(dothill_fc.DotHillFCDriver):
super(LenovoFCDriver, self).__init__(*args, **kwargs)
self.configuration.append_config_values(lenovo_common.common_opts)
@staticmethod
def get_driver_options():
return lenovo_common.common_opts
def _init_common(self):
return lenovo_common.LenovoCommon(self.configuration)

4
cinder/volume/drivers/lenovo/lenovo_iscsi.py

@ -45,5 +45,9 @@ class LenovoISCSIDriver(dothill_iscsi.DotHillISCSIDriver):
self.configuration.append_config_values(lenovo_common.iscsi_opts)
self.iscsi_ips = self.configuration.lenovo_iscsi_ips
@staticmethod
def get_driver_options():
return lenovo_common.common_opts + lenovo_common.iscsi_opts
def _init_common(self):
return lenovo_common.LenovoCommon(self.configuration)

4
cinder/volume/drivers/linstordrv.py

@ -117,6 +117,10 @@ class LinstorBaseDriver(driver.VolumeDriver):
'volume_backend_name')
self.host_name = socket.gethostname()
@staticmethod
def get_driver_options():
return linstor_opts
def _ping(self):
with lin_drv(self.default_uri) as lin:
return lin.ping()

4
cinder/volume/drivers/lvm.py

@ -112,6 +112,10 @@ class LVMVolumeDriver(driver.VolumeDriver):
self.protocol = self.target_driver.protocol
self._sparse_copy_volume = False
@staticmethod
def get_driver_options():
return volume_opts
def _sizestr(self, size_in_g):
return '%sg' % size_in_g

9
cinder/volume/drivers/nec/volume.py

@ -18,6 +18,7 @@
from cinder import interface
from cinder.volume import driver
from cinder.volume.drivers.nec import volume_common
from cinder.volume.drivers.nec import volume_helper
from cinder.zonemanager import utils as fczm_utils
@ -35,6 +36,10 @@ class MStorageISCSIDriver(volume_helper.MStorageDSVDriver,
self._set_config(self.configuration, self.host,
self.__class__.__name__)
@staticmethod
def get_driver_options():
return volume_common.mstorage_opts
def create_export(self, context, volume, connector):
return self.iscsi_do_export(context, volume, connector)
@ -77,6 +82,10 @@ class MStorageFCDriver(volume_helper.MStorageDSVDriver,
self._set_config(self.configuration, self.host,
self.__class__.__name__)
@staticmethod
def get_driver_options():
return volume_common.mstorage_opts
def create_export(self, context, volume, connector):
return self.fc_do_export(context, volume, connector)

5
cinder/volume/drivers/netapp/dataontap/fc_cmode.py

@ -19,6 +19,7 @@ Volume driver for NetApp Data ONTAP FibreChannel storage systems.
from cinder import interface
from cinder.volume import driver
from cinder.volume.drivers.netapp.dataontap import block_cmode
from cinder.volume.drivers.netapp import options as na_opts
from cinder.zonemanager import utils as fczm_utils
@ -38,6 +39,10 @@ class NetAppCmodeFibreChannelDriver(driver.BaseVD,
self.library = block_cmode.NetAppBlockStorageCmodeLibrary(
self.DRIVER_NAME, 'FC', **kwargs)
@staticmethod
def get_driver_options():
return na_opts.netapp_cluster_opts
def do_setup(self, context):
self.library.do_setup(context)

5
cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py

@ -19,6 +19,7 @@ Volume driver for NetApp Data ONTAP (C-mode) iSCSI storage systems.
from cinder import interface
from cinder.volume import driver
from cinder.volume.drivers.netapp.dataontap import block_cmode
from cinder.volume.drivers.netapp import options as na_opts
@interface.volumedriver
@ -37,6 +38,10 @@ class NetAppCmodeISCSIDriver(driver.BaseVD,
self.library = block_cmode.NetAppBlockStorageCmodeLibrary(
self.DRIVER_NAME, 'iSCSI', **kwargs)
@staticmethod
def get_driver_options():
return na_opts.netapp_cluster_opts
def do_setup(self, context):
self.library.do_setup(context)

5
cinder/volume/drivers/nexenta/iscsi.py

@ -91,6 +91,11 @@ class NexentaISCSIDriver(driver.ISCSIDriver):
self._needless_objects = set()
@staticmethod
def get_driver_options():
return (options.NEXENTA_CONNECTION_OPTS + options.NEXENTA_ISCSI_OPTS +
options.NEXENTA_DATASET_OPTS + options.NEXENTA_RRMGR_OPTS)
@property
def backend_name(self):
backend_name = None

14
cinder/volume/drivers/nexenta/nexentaedge/iscsi.py

@ -33,7 +33,10 @@ LOG = logging.getLogger(__name__)
class NexentaEdgeISCSIDriver(driver.ISCSIDriver):
"""Executes volume driver commands on NexentaEdge cluster.
Version history:
.. code-block:: none
Version history:
1.0.0 - Initial driver version.
1.0.1 - Moved opts to options.py.
1.0.2 - Added HA support.
@ -98,6 +101,15 @@ class NexentaEdgeISCSIDriver(driver.ISCSIDriver):
nexenta_iscsi_target_portal_port)
self.ha_vip = None
@staticmethod
def get_driver_options():
return (
options.NEXENTA_CONNECTION_OPTS +
options.NEXENTA_ISCSI_OPTS +
options.NEXENTA_DATASET_OPTS +
options.NEXENTA_EDGE_OPTS
)
@property
def backend_name(self):
backend_name = None

9
cinder/volume/drivers/nexenta/nfs.py

@ -94,6 +94,15 @@ class NexentaNfsDriver(nfs.NfsDriver): # pylint: disable=R0921
self.nfs_versions = {}
self.shares_with_capacities = {}
@staticmethod
def get_driver_options():
return (
options.NEXENTA_CONNECTION_OPTS +
options.NEXENTA_NFS_OPTS +
options.NEXENTA_DATASET_OPTS +
options.NEXENTA_RRMGR_OPTS
)
@property
def backend_name(self):
backend_name = None

9
cinder/volume/drivers/nexenta/ns5/iscsi.py

@ -82,6 +82,15 @@ class NexentaISCSIDriver(driver.ISCSIDriver):
self.iscsi_target_portal_port = (
self.configuration.nexenta_iscsi_target_portal_port)
@staticmethod
def get_driver_options():
return (
options.NEXENTA_CONNECTION_OPTS +
options.NEXENTA_ISCSI_OPTS +
options.NEXENTA_DATASET_OPTS +
options.NEXENTA_RRMGR_OPTS
)
@property
def backend_name(self):
backend_name = None

8
cinder/volume/drivers/nexenta/ns5/nfs.py

@ -83,6 +83,14 @@ class NexentaNfsDriver(nfs.NfsDriver):
self.nef_user = self.configuration.nexenta_user
self.nef_password = self.configuration.nexenta_password
@staticmethod
def get_driver_options():
return (
options.NEXENTA_CONNECTION_OPTS +
options.NEXENTA_NFS_OPTS +
options.NEXENTA_DATASET_OPTS
)
@property
def backend_name(self):
backend_name = None

4
cinder/volume/drivers/nfs.py

@ -122,6 +122,10 @@ class NfsDriver(remotefs.RemoteFSSnapDriverDistributed):
self.configuration.max_over_subscription_ratio,
supports_auto=supports_auto_mosr))
@staticmethod
def get_driver_options():
return nfs_opts + remotefs.nas_opts
def initialize_connection(self, volume, connector):
LOG.debug('Initializing connection to volume %(vol)s. '

4
cinder/volume/drivers/nimble.py

@ -149,6 +149,10 @@ class NimbleBaseVolumeDriver(san.SanDriver):
if self.configuration.nimble_verify_certificate is True:
self.verify = self.configuration.nimble_verify_cert_path or True
@staticmethod
def get_driver_options():
return nimble_opts
def _check_config(self):
"""Ensure that the flags we care about are set."""
required_config = ['san_ip', 'san_login', 'san_password']

4
cinder/volume/drivers/prophetstor/dplcommon.py

@ -695,6 +695,10 @@ class DPLCOMMONDriver(driver.CloneableImageVD,
cert_path=cert_path)
self._stats = {}
@staticmethod
def get_driver_options():
return options.DPL_OPTS
def _convert_size_GB(self, size):
s = round(float(size) / units.Gi, 2)
if s > 0:

4
cinder/volume/drivers/pure.py

@ -203,6 +203,10 @@ class PureBaseVolumeDriver(san.SanDriver):
'platform': platform.platform()
}
@staticmethod
def get_driver_options():
return PURE_OPTS
def parse_replication_configs(self):
self._replication_pg_name = (
self.configuration.pure_replication_pg_name)

7
cinder/volume/drivers/qnap.py

@ -63,7 +63,8 @@ CONF.register_opts(qnap_opts, group=configuration.SHARED_CONF_GROUP)
class QnapISCSIDriver(san.SanISCSIDriver):
"""QNAP iSCSI based cinder driver
.. code-block:: default
.. code-block:: none
Version History:
1.0.0:
@ -105,6 +106,10 @@ class QnapISCSIDriver(san.SanISCSIDriver):
self.target_iqns = []
self.nasInfoCache = {}
@staticmethod
def get_driver_options():
return qnap_opts
def _check_config(self):
"""Ensure that the flags we care about are set."""
LOG.debug('in _check_config')

10
cinder/volume/drivers/quobyte.py

@ -96,7 +96,11 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
Note: To be compliant with the inherited RemoteFSSnapDriver, Quobyte
volumes are also referred to as shares.
Version history:
.. code-block:: none
Version history:
1.0 - Initial driver.
1.1 - Adds optional insecure NAS settings
1.1.1 - Removes getfattr calls from driver
@ -130,6 +134,10 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
# Used to manage snapshots which are currently attached to a VM.
self._nova = None
@staticmethod
def get_driver_options():
return volume_opts
def _create_regular_file(self, path, size):
"""Creates a regular file of given size in GiB using fallocate."""
self._fallocate_file(path, size)

4
cinder/volume/drivers/rbd.py

@ -243,6 +243,10 @@ class RBDDriver(driver.CloneableImageVD, driver.MigrateVD,
self._replication_targets = []
self._target_names = []
@staticmethod
def get_driver_options():
return RBD_OPTS
def _get_target_config(self, target_id):
"""Get a replication target from known replication targets."""
for target in self._replication_targets:

4
cinder/volume/drivers/san/hp/hpmsa_fc.py

@ -43,5 +43,9 @@ class HPMSAFCDriver(dothill_fc.DotHillFCDriver):
super(HPMSAFCDriver, self).__init__(*args, **kwargs)
self.configuration.append_config_values(hpmsa_common.common_opts)
@staticmethod
def get_driver_options():
return hpmsa_common.common_opts
def _init_common(self):
return hpmsa_common.HPMSACommon(self.configuration)

4
cinder/volume/drivers/san/hp/hpmsa_iscsi.py

@ -45,5 +45,9 @@ class HPMSAISCSIDriver(dothill_iscsi.DotHillISCSIDriver):
self.configuration.append_config_values(hpmsa_common.iscsi_opts)
self.iscsi_ips = self.configuration.hpmsa_iscsi_ips
@staticmethod
def get_driver_options():
return hpmsa_common.common_opts + hpmsa_common.iscsi_opts
def _init_common(self):
return hpmsa_common.HPMSACommon(self.configuration)

4
cinder/volume/drivers/sheepdog.py

@ -452,6 +452,10 @@ class SheepdogDriver(driver.VolumeDriver):
self.node_list = [addr]
self.client = SheepdogClient(self.node_list, self.port)
@staticmethod
def get_driver_options():
return sheepdog_opts
def check_for_setup_error(self):
"""Check cluster status and update node list."""
self.client.check_cluster_status()

4
cinder/volume/drivers/solidfire.py

@ -292,6 +292,10 @@ class SolidFireDriver(san.SanISCSIDriver):
self._set_cluster_pairs()
@staticmethod
def get_driver_options():
return sf_opts
def __getattr__(self, attr):
if hasattr(self.target_driver, attr):
return getattr(self.target_driver, attr)

4
cinder/volume/drivers/spdk.py

@ -59,6 +59,10 @@ class SPDKDriver(driver.VolumeDriver):
db=self.db,
executor=self._execute)
@staticmethod
def get_driver_options():
return []
def _rpc_call(self, method, params=None):
payload = {}
payload['jsonrpc'] = '2.0'

4
cinder/volume/drivers/storpool.py

@ -99,6 +99,10 @@ class StorPoolDriver(driver.VolumeDriver):
self._ourIdInt = None
self._attach = None
@staticmethod
def get_driver_options():
return storpool_opts
def _backendException(self, e):
return exception.VolumeBackendAPIException(data=six.text_type(e))

8
cinder/volume/drivers/synology/synology_iscsi.py

@ -27,7 +27,9 @@ LOG = logging.getLogger(__name__)
class SynoISCSIDriver(driver.ISCSIDriver):
"""OpenStack Cinder drivers for Synology storage.
Version history:
.. code-block:: none
Version history:
1.0.0 - Initial driver. Provide Cinder minimum features
"""
# ThirdPartySystems wiki page
@ -41,6 +43,10 @@ class SynoISCSIDriver(driver.ISCSIDriver):
self.configuration.append_config_values(common.cinder_opts)
self.stats = {}
@staticmethod
def get_driver_options():
return common.cinder_opts
def do_setup(self, context):
self.common = common.SynoCommon(self.configuration, 'iscsi')

4
cinder/volume/drivers/veritas/vrtshyperscale.py

@ -69,6 +69,10 @@ class HyperScaleDriver(driver.VolumeDriver):
self.old_free = 0
self.my_dnid = None
@staticmethod
def get_driver_options():
return []
@staticmethod
def _fetch_config_for_controller():
return HyperScaleDriver._fetch_config_information(

8
cinder/volume/drivers/veritas_access/veritas_iscsi.py

@ -74,7 +74,9 @@ class ACCESSIscsiDriver(driver.ISCSIDriver):
Executes commands relating to ACCESS ISCSI.
Supports creation of volumes on ACCESS.
API version history:
.. code-block:: none
API version history:
1.0 - Initial version.
"""
@ -124,6 +126,10 @@ class ACCESSIscsiDriver(driver.ISCSIDriver):
if verify_path:
self.verify = verify_path
@staticmethod
def get_driver_options():
return VA_VOL_OPTS
def do_setup(self, context):
"""Any initialization the volume driver does while starting."""
super(ACCESSIscsiDriver, self).do_setup(context)

4
cinder/volume/drivers/vmware/vmdk.py

@ -293,6 +293,10 @@ class VMwareVcVmdkDriver(driver.VolumeDriver):
self._dc_cache = {}
self._ds_regex = None
@staticmethod
def get_driver_options():
return vmdk_opts
@property
def volumeops(self):
return self._volumeops

8
cinder/volume/drivers/vzstorage.py

@ -126,7 +126,9 @@ class VZStorageDriver(remotefs_drv.RemoteFSSnapDriver):
Creates volumes as files on the mounted vzstorage cluster.
Version history:
.. code-block:: none
Version history:
1.0 - Initial driver.
1.1 - Supports vz:volume_format in vendor properties.
"""
@ -153,6 +155,10 @@ class VZStorageDriver(remotefs_drv.RemoteFSSnapDriver):
vzstorage_mount_point_base=self.base,
vzstorage_mount_options=opts)
@staticmethod
def get_driver_options():
return vzstorage_opts
def _update_volume_stats(self):
super(VZStorageDriver, self)._update_volume_stats()
self._stats['vendor_name'] = 'Virtuozzo'

4
cinder/volume/drivers/windows/iscsi.py

@ -67,6 +67,10 @@ class WindowsISCSIDriver(driver.ISCSIDriver):
self._tgt_utils = utilsfactory.get_iscsi_target_utils()
self._hostutils = utilsfactory.get_hostutils()
@staticmethod
def get_driver_options():
return windows_opts
def do_setup(self, context):
"""Setup the Windows Volume driver.

4
cinder/volume/drivers/windows/smbfs.py

@ -124,6 +124,10 @@ class WindowsSmbfsDriver(remotefs_drv.RevertToSnapshotMixin,
self._thin_provisioning_support = thin_enabled
self._thick_provisioning_support = not thin_enabled
@staticmethod
def get_driver_options():
return volume_opts
def do_setup(self, context):
self._check_os_platform()

8
cinder/volume/drivers/zadara.py

@ -285,7 +285,9 @@ class ZadaraVPSAConnection(object):
class ZadaraVPSAISCSIDriver(driver.ISCSIDriver):
"""Zadara VPSA iSCSI/iSER volume driver.
Version history:
.. code-block:: none
Version history:
15.07 - Initial driver
16.05 - Move from httplib to requests
"""
@ -299,6 +301,10 @@ class ZadaraVPSAISCSIDriver(driver.ISCSIDriver):
super(ZadaraVPSAISCSIDriver, self).__init__(*args, **kwargs)
self.configuration.append_config_values(zadara_opts)
@staticmethod
def get_driver_options():
return zadara_opts
def do_setup(self, context):
"""Any initialization the volume driver does while starting.

4
cinder/volume/drivers/zfssa/zfssaiscsi.py

@ -140,6 +140,10 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
self._stats = None
self.tgtiqn = None
@staticmethod
def get_driver_options():
return ZFSSA_OPTS
def _get_target_alias(self):
"""return target alias."""
return self.configuration.zfssa_target_group

8
cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py

@ -65,7 +65,9 @@ class BrcdFCZoneDriver(fc_zone_driver.FCZoneDriver):
OpenStack Fibre Channel zone driver to manage FC zoning in
Brocade SAN fabrics.
Version history:
.. code-block:: none
Version history:
1.0 - Initial Brocade FC zone driver
1.1 - Implements performance enhancements
1.2 - Added support for friendly zone name
@ -111,6 +113,10 @@ class BrcdFCZoneDriver(fc_zone_driver.FCZoneDriver):
self.fabric_configs = fabric_opts.load_fabric_configurations(
fabric_names)
@staticmethod
def get_driver_options():
return brcd_opts
@lockutils.synchronized('brcd', 'fcfabric-', True)
def add_connection(self, fabric, initiator_target_map, host_name=None,
storage_system=None):

8
cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py

@ -65,7 +65,9 @@ class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
OpenStack Fibre Channel zone driver to manage FC zoning in
Cisco SAN fabrics.
Version history:
.. code-block:: none
Version history:
1.0 - Initial Cisco FC zone driver
1.1 - Added friendly zone name support
"""
@ -118,6 +120,10 @@ class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
self.fabric_configs = fabric_opts.load_fabric_configurations(
fabric_names)
@staticmethod
def get_driver_options():
return cisco_opts
@lockutils.synchronized('cisco', 'fcfabric-', True)
def add_connection(self, fabric, initiator_target_map, host_name=None,
storage_system=None):

63
tools/generate_driver_list.py

@ -15,6 +15,7 @@
"""Generate list of Cinder drivers"""
import argparse
import operator
import os
import json
import textwrap
@ -73,19 +74,56 @@ def format_description(desc, output):
output.write('')
output.write(textwrap.dedent('\n'.join(lines[1:])))
def print_drivers(drivers, config_name, output):
for driver in sorted(drivers, key=lambda x: x.class_fqn):
driver_name = driver.class_name
def format_options(driver_options, output):
if driver_options and len(driver_options) > 0:
output.write('* Driver Configuration Options:')
output.write('')
output.write('.. list-table:: **Driver configuration options**')
output.write(' :header-rows: 1')
output.write(' :widths: 14 30')
output.write('')
output.write(' * - Name = Default Value')
output.write(' - (Type) Description')
sorted_options = sorted(driver_options,
key=operator.attrgetter('name'))
for opt in sorted_options:
output.write(' * - %s = %s' %
(opt.name, opt.default))
output.write(' - (%s) %s' % (opt.type, opt.help))
output.write('')
def filter_drivers(drivers):
'''This filters all of the drivers into separate lists.'''
supported_drivers = []
unsupported_drivers = []
for driver in drivers:
if not driver.supported:
unsupported_drivers.append(driver)
else:
supported_drivers.append(driver)
return supported_drivers, unsupported_drivers
def print_drivers(drivers, config_name, output, section_char='-',
display_unsupported=True):
for driver in sorted(drivers, key=lambda x: x.class_name):
driver_name = driver.class_name
if not driver.supported and display_unsupported:
driver_name += " (unsupported)"
output.write(driver_name)
output.write('-' * len(driver_name))
output.write(section_char * len(driver_name))
if driver.version:
output.write('* Version: %s' % driver.version)
output.write('* %s=%s' % (config_name, driver.class_fqn))
if driver.ci_wiki_name and 'Cinder_Jenkins' not in driver.ci_wiki_name:
output.write('* CI info: %s%s' % (CI_WIKI_ROOT,
driver.ci_wiki_name))
format_options(driver.driver_options, output)
format_description(driver.desc, output)
output.write('')
output.write('')
@ -95,7 +133,18 @@ def output_str(cinder_root, args):
with Output(cinder_root, args.output_list) as output:
output.write('Volume Drivers')
output.write('==============')
print_drivers(util.get_volume_drivers(), 'volume_driver', output)
supported_drivers, unsupported_drivers = filter_drivers(