diff --git a/cinder/backup/drivers/ceph.py b/cinder/backup/drivers/ceph.py index fa941b4e0c9..020150acea4 100644 --- a/cinder/backup/drivers/ceph.py +++ b/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) diff --git a/cinder/backup/drivers/gcs.py b/cinder/backup/drivers/gcs.py index 28746d6ac07..2831cb31c24 100644 --- a/cinder/backup/drivers/gcs.py +++ b/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') diff --git a/cinder/backup/drivers/glusterfs.py b/cinder/backup/drivers/glusterfs.py index 53740528549..0260fbfd2d0 100644 --- a/cinder/backup/drivers/glusterfs.py +++ b/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'] diff --git a/cinder/backup/drivers/posix.py b/cinder/backup/drivers/posix.py index d07310e0735..ddc873cd314 100644 --- a/cinder/backup/drivers/posix.py +++ b/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 diff --git a/cinder/backup/drivers/swift.py b/cinder/backup/drivers/swift.py index e1b0cf2e02c..9889b3650c0 100644 --- a/cinder/backup/drivers/swift.py +++ b/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 diff --git a/cinder/backup/drivers/tsm.py b/cinder/backup/drivers/tsm.py index ab598bf4d81..5454417901c 100644 --- a/cinder/backup/drivers/tsm.py +++ b/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: diff --git a/cinder/interface/util.py b/cinder/interface/util.py index 15226b0853e..dde18a335d0 100644 --- a/cinder/interface/util.py +++ b/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 diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 428cf4bcf60..66817e9f4b3 100644 --- a/cinder/volume/driver.py +++ b/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. diff --git a/cinder/volume/drivers/datacore/driver.py b/cinder/volume/drivers/datacore/driver.py index 1bacd0a4caa..fb38a28c882 100644 --- a/cinder/volume/drivers/datacore/driver.py +++ b/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. diff --git a/cinder/volume/drivers/dell_emc/powermax/fc.py b/cinder/volume/drivers/dell_emc/powermax/fc.py index e5539c4ac31..11723852c3c 100644 --- a/cinder/volume/drivers/dell_emc/powermax/fc.py +++ b/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 diff --git a/cinder/volume/drivers/dell_emc/powermax/iscsi.py b/cinder/volume/drivers/dell_emc/powermax/iscsi.py index f524f361ae4..bb7a548e16d 100644 --- a/cinder/volume/drivers/dell_emc/powermax/iscsi.py +++ b/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 diff --git a/cinder/volume/drivers/dell_emc/ps.py b/cinder/volume/drivers/dell_emc/ps.py index f6147c87179..4848121a4a0 100644 --- a/cinder/volume/drivers/dell_emc/ps.py +++ b/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 diff --git a/cinder/volume/drivers/dell_emc/sc/storagecenter_common.py b/cinder/volume/drivers/dell_emc/sc/storagecenter_common.py index eb7668dfe00..40dba788e22 100644 --- a/cinder/volume/drivers/dell_emc/sc/storagecenter_common.py +++ b/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 ... diff --git a/cinder/volume/drivers/dell_emc/scaleio/driver.py b/cinder/volume/drivers/dell_emc/scaleio/driver.py index ea64f03d429..20e019b32ca 100644 --- a/cinder/volume/drivers/dell_emc/scaleio/driver.py +++ b/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 diff --git a/cinder/volume/drivers/dell_emc/unity/driver.py b/cinder/volume/drivers/dell_emc/unity/driver.py index aed0d161b2d..5647686ff78 100644 --- a/cinder/volume/drivers/dell_emc/unity/driver.py +++ b/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) diff --git a/cinder/volume/drivers/dell_emc/vnx/driver.py b/cinder/volume/drivers/dell_emc/vnx/driver.py index 156de720266..032a6ad5811 100644 --- a/cinder/volume/drivers/dell_emc/vnx/driver.py +++ b/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, diff --git a/cinder/volume/drivers/dell_emc/xtremio.py b/cinder/volume/drivers/dell_emc/xtremio.py index 2f4249d520c..e9522f228e5 100644 --- a/cinder/volume/drivers/dell_emc/xtremio.py +++ b/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'] diff --git a/cinder/volume/drivers/drbdmanagedrv.py b/cinder/volume/drivers/drbdmanagedrv.py index 0a593661f3d..22780a4375b 100644 --- a/cinder/volume/drivers/drbdmanagedrv.py +++ b/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) diff --git a/cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_common.py b/cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_common.py index d01b1f94191..7de2b4bc548 100644 --- a/cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_common.py +++ b/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, ' diff --git a/cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_fc.py b/cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_fc.py index 4f8c362d2b5..b5c8bf398cd 100644 --- a/cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_fc.py +++ b/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! ' diff --git a/cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_iscsi.py b/cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_iscsi.py index e13c7b710ce..27e36d4f2a5 100644 --- a/cinder/volume/drivers/fujitsu/eternus_dx/eternus_dx_iscsi.py +++ b/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! ' diff --git a/cinder/volume/drivers/fusionstorage/dsware.py b/cinder/volume/drivers/fusionstorage/dsware.py index 7cf1a3db1ed..9595b80b331 100644 --- a/cinder/volume/drivers/fusionstorage/dsware.py +++ b/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 diff --git a/cinder/volume/drivers/hedvig/hedvig_cinder.py b/cinder/volume/drivers/hedvig/hedvig_cinder.py index a3a6d0c2e59..89098392de8 100644 --- a/cinder/volume/drivers/hedvig/hedvig_cinder.py +++ b/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") diff --git a/cinder/volume/drivers/hpe/hpe_3par_base.py b/cinder/volume/drivers/hpe/hpe_3par_base.py index 37ca5a16a19..575e5c0968f 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_base.py +++ b/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) diff --git a/cinder/volume/drivers/hpe/hpe_3par_common.py b/cinder/volume/drivers/hpe/hpe_3par_common.py index f0fb00f4b26..d6442a503d1 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_common.py +++ b/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): diff --git a/cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py b/cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py index 9d2374531d8..a825a4b9cd9 100644 --- a/cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py +++ b/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: diff --git a/cinder/volume/drivers/huawei/common.py b/cinder/volume/drivers/huawei/common.py index c270a6d0b13..0a447fe1fdd 100644 --- a/cinder/volume/drivers/huawei/common.py +++ b/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) diff --git a/cinder/volume/drivers/ibm/flashsystem_common.py b/cinder/volume/drivers/ibm/flashsystem_common.py index 76982cab230..979e5eca7b0 100644 --- a/cinder/volume/drivers/ibm/flashsystem_common.py +++ b/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) diff --git a/cinder/volume/drivers/ibm/gpfs.py b/cinder/volume/drivers/ibm/gpfs.py index 57c0ea7b544..5ed7fd83079 100644 --- a/cinder/volume/drivers/ibm/gpfs.py +++ b/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) diff --git a/cinder/volume/drivers/ibm/ibm_storage/ibm_storage.py b/cinder/volume/drivers/ibm/ibm_storage/ibm_storage.py index 128ce5bb25a..8b28cac0ff7 100644 --- a/cinder/volume/drivers/ibm/ibm_storage/ibm_storage.py +++ b/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.""" diff --git a/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_fc.py b/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_fc.py index dc3d5e10799..dc05d76e904 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_fc.py +++ b/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: diff --git a/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_iscsi.py b/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_iscsi.py index 82586b130ab..fd2871aeb05 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_iscsi.py +++ b/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: diff --git a/cinder/volume/drivers/infinidat.py b/cinder/volume/drivers/infinidat.py index a2b2af8b0da..65501b21486 100644 --- a/cinder/volume/drivers/infinidat.py +++ b/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( diff --git a/cinder/volume/drivers/inspur/as13000/as13000_driver.py b/cinder/volume/drivers/inspur/as13000/as13000_driver.py index 1de5cf00a27..944880beffc 100644 --- a/cinder/volume/drivers/inspur/as13000/as13000_driver.py +++ b/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 diff --git a/cinder/volume/drivers/inspur/instorage/instorage_common.py b/cinder/volume/drivers/inspur/instorage/instorage_common.py index db96847585e..b7792a0f7bd 100644 --- a/cinder/volume/drivers/inspur/instorage/instorage_common.py +++ b/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.""" diff --git a/cinder/volume/drivers/kaminario/kaminario_common.py b/cinder/volume/drivers/kaminario/kaminario_common.py index b1105f4dd2d..daa04a41532 100644 --- a/cinder/volume/drivers/kaminario/kaminario_common.py +++ b/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: diff --git a/cinder/volume/drivers/kaminario/kaminario_iscsi.py b/cinder/volume/drivers/kaminario/kaminario_iscsi.py index a85df2efcbe..9d36253dc75 100644 --- a/cinder/volume/drivers/kaminario/kaminario_iscsi.py +++ b/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 diff --git a/cinder/volume/drivers/lenovo/lenovo_fc.py b/cinder/volume/drivers/lenovo/lenovo_fc.py index 5a05d7ecae2..3df296d84c3 100644 --- a/cinder/volume/drivers/lenovo/lenovo_fc.py +++ b/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) diff --git a/cinder/volume/drivers/lenovo/lenovo_iscsi.py b/cinder/volume/drivers/lenovo/lenovo_iscsi.py index 92dabe7c6f6..cc2d1de646f 100644 --- a/cinder/volume/drivers/lenovo/lenovo_iscsi.py +++ b/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) diff --git a/cinder/volume/drivers/linstordrv.py b/cinder/volume/drivers/linstordrv.py index 6c93d0d991c..9dd688c5391 100644 --- a/cinder/volume/drivers/linstordrv.py +++ b/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() diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index c40e7ba2f46..ef86377bdfe 100644 --- a/cinder/volume/drivers/lvm.py +++ b/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 diff --git a/cinder/volume/drivers/nec/volume.py b/cinder/volume/drivers/nec/volume.py index 155ee0d5a93..a9849ed22d0 100644 --- a/cinder/volume/drivers/nec/volume.py +++ b/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) diff --git a/cinder/volume/drivers/netapp/dataontap/fc_cmode.py b/cinder/volume/drivers/netapp/dataontap/fc_cmode.py index adc6e3f448d..bdd493d1d05 100644 --- a/cinder/volume/drivers/netapp/dataontap/fc_cmode.py +++ b/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) diff --git a/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py b/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py index 8487f23fdb8..325eed78bf9 100644 --- a/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py +++ b/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) diff --git a/cinder/volume/drivers/nexenta/iscsi.py b/cinder/volume/drivers/nexenta/iscsi.py index 0240f22d23e..33c7d8b7dd5 100644 --- a/cinder/volume/drivers/nexenta/iscsi.py +++ b/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 diff --git a/cinder/volume/drivers/nexenta/nexentaedge/iscsi.py b/cinder/volume/drivers/nexenta/nexentaedge/iscsi.py index 6e49c98d228..9982369fb9f 100644 --- a/cinder/volume/drivers/nexenta/nexentaedge/iscsi.py +++ b/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 diff --git a/cinder/volume/drivers/nexenta/nfs.py b/cinder/volume/drivers/nexenta/nfs.py index 1cd1f79925d..ae65256aeca 100644 --- a/cinder/volume/drivers/nexenta/nfs.py +++ b/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 diff --git a/cinder/volume/drivers/nexenta/ns5/iscsi.py b/cinder/volume/drivers/nexenta/ns5/iscsi.py index d205614acec..301603b2195 100644 --- a/cinder/volume/drivers/nexenta/ns5/iscsi.py +++ b/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 diff --git a/cinder/volume/drivers/nexenta/ns5/nfs.py b/cinder/volume/drivers/nexenta/ns5/nfs.py index 143ab8ea111..fc8801f62b6 100644 --- a/cinder/volume/drivers/nexenta/ns5/nfs.py +++ b/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 diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py index 0d57c3b9f2f..ada70677dc8 100644 --- a/cinder/volume/drivers/nfs.py +++ b/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. ' diff --git a/cinder/volume/drivers/nimble.py b/cinder/volume/drivers/nimble.py index 40906089a6f..598824373d5 100644 --- a/cinder/volume/drivers/nimble.py +++ b/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'] diff --git a/cinder/volume/drivers/prophetstor/dplcommon.py b/cinder/volume/drivers/prophetstor/dplcommon.py index d1334c72636..ec7ed75f94f 100644 --- a/cinder/volume/drivers/prophetstor/dplcommon.py +++ b/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: diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index 1fec72235a1..25c873d5542 100644 --- a/cinder/volume/drivers/pure.py +++ b/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) diff --git a/cinder/volume/drivers/qnap.py b/cinder/volume/drivers/qnap.py index 4d6f09795c1..517dfaafeec 100644 --- a/cinder/volume/drivers/qnap.py +++ b/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') diff --git a/cinder/volume/drivers/quobyte.py b/cinder/volume/drivers/quobyte.py index 3a6f3175adf..e64b1856877 100644 --- a/cinder/volume/drivers/quobyte.py +++ b/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) diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index 4e6419ed19b..78d746e9b5a 100644 --- a/cinder/volume/drivers/rbd.py +++ b/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: diff --git a/cinder/volume/drivers/san/hp/hpmsa_fc.py b/cinder/volume/drivers/san/hp/hpmsa_fc.py index 959e9d664af..0ac0cb3d36b 100644 --- a/cinder/volume/drivers/san/hp/hpmsa_fc.py +++ b/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) diff --git a/cinder/volume/drivers/san/hp/hpmsa_iscsi.py b/cinder/volume/drivers/san/hp/hpmsa_iscsi.py index b5ca9289da6..7db1fc401b0 100644 --- a/cinder/volume/drivers/san/hp/hpmsa_iscsi.py +++ b/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) diff --git a/cinder/volume/drivers/sheepdog.py b/cinder/volume/drivers/sheepdog.py index a2b4bc513e3..eb7d31cc101 100644 --- a/cinder/volume/drivers/sheepdog.py +++ b/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() diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index f3154031a54..d1f2328f3a9 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/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) diff --git a/cinder/volume/drivers/spdk.py b/cinder/volume/drivers/spdk.py index 26e3feb55d6..35016819fc8 100644 --- a/cinder/volume/drivers/spdk.py +++ b/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' diff --git a/cinder/volume/drivers/storpool.py b/cinder/volume/drivers/storpool.py index 1dda184b498..b562b16b172 100644 --- a/cinder/volume/drivers/storpool.py +++ b/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)) diff --git a/cinder/volume/drivers/synology/synology_iscsi.py b/cinder/volume/drivers/synology/synology_iscsi.py index a2cc2ad9016..f5c91ce0dd4 100644 --- a/cinder/volume/drivers/synology/synology_iscsi.py +++ b/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') diff --git a/cinder/volume/drivers/veritas/vrtshyperscale.py b/cinder/volume/drivers/veritas/vrtshyperscale.py index 01abb1b97d3..e93cc51f4e6 100644 --- a/cinder/volume/drivers/veritas/vrtshyperscale.py +++ b/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( diff --git a/cinder/volume/drivers/veritas_access/veritas_iscsi.py b/cinder/volume/drivers/veritas_access/veritas_iscsi.py index e6dfcc08f78..81e5c26d3f5 100644 --- a/cinder/volume/drivers/veritas_access/veritas_iscsi.py +++ b/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) diff --git a/cinder/volume/drivers/vmware/vmdk.py b/cinder/volume/drivers/vmware/vmdk.py index f21d4cde35b..503d9be86e9 100644 --- a/cinder/volume/drivers/vmware/vmdk.py +++ b/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 diff --git a/cinder/volume/drivers/vzstorage.py b/cinder/volume/drivers/vzstorage.py index 851836600a1..29f59e2b8db 100644 --- a/cinder/volume/drivers/vzstorage.py +++ b/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' diff --git a/cinder/volume/drivers/windows/iscsi.py b/cinder/volume/drivers/windows/iscsi.py index 0e618135034..f15907a1b04 100644 --- a/cinder/volume/drivers/windows/iscsi.py +++ b/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. diff --git a/cinder/volume/drivers/windows/smbfs.py b/cinder/volume/drivers/windows/smbfs.py index e796719029c..623f9515c20 100644 --- a/cinder/volume/drivers/windows/smbfs.py +++ b/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() diff --git a/cinder/volume/drivers/zadara.py b/cinder/volume/drivers/zadara.py index 68184957241..1eba2aae6ee 100644 --- a/cinder/volume/drivers/zadara.py +++ b/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. diff --git a/cinder/volume/drivers/zfssa/zfssaiscsi.py b/cinder/volume/drivers/zfssa/zfssaiscsi.py index 7790c9e6629..a46d465adc9 100644 --- a/cinder/volume/drivers/zfssa/zfssaiscsi.py +++ b/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 diff --git a/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py b/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py index c4529e3b663..d24f9eca5f6 100644 --- a/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py +++ b/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): diff --git a/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py b/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py index 2ee43983ce8..ecfae36f146 100644 --- a/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py +++ b/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): diff --git a/tools/generate_driver_list.py b/tools/generate_driver_list.py index e35d810d589..8d18bc787cc 100755 --- a/tools/generate_driver_list.py +++ b/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( + util.get_volume_drivers()) + + output.write('Supported Drivers') + output.write('-----------------') + output.write('') + print_drivers(supported_drivers, 'volume_driver', output, '~') + + output.write('Unsupported Drivers') + output.write('-------------------') + output.write('') + print_drivers(unsupported_drivers, 'volume_driver', output, '~') output.write('Backup Drivers') output.write('==============') @@ -114,7 +163,9 @@ def collect_driver_info(driver): 'fqn': driver.class_fqn, 'description': driver.desc, 'ci_wiki_name': driver.ci_wiki_name, - 'supported': driver.supported} + 'supported': driver.supported, + 'options': driver.driver_options, + } return info