remove support for deprecated options in VxFlex OS driver

VxFlex OS driver drops support for options, which
were marked as deprecated more than one release ago.
Remove config options:
 sio_protection_domain_id
 sio_protection_domain_name
 sio_storage_pool_name
 sio_storage_pool_id
Remove volume type options:
 sio:sp_name
 sio:sp_id
 sio:pd_name
 sio:pd_id
 sio:provisioning_type
 sio:iops_limit
 sio:bandwidth_limit

Change-Id: I8df09848e6df0cd4ade7d96af8ccc3ba6783794b
This commit is contained in:
Yury Kulazhenkov 2019-02-19 20:25:36 +03:00
parent 0eaca453bc
commit 7fb9b430ee
7 changed files with 35 additions and 318 deletions

View File

@ -137,12 +137,6 @@ class TestVxFlexOSDriver(test.TestCase):
group=conf.SHARED_CONF_GROUP)
self.override_config('san_password', override='pass',
group=conf.SHARED_CONF_GROUP)
self.override_config('sio_storage_pool_id',
override=self.STORAGE_POOL_ID,
group=conf.SHARED_CONF_GROUP)
self.override_config('sio_protection_domain_id',
override=self.PROT_DOMAIN_ID,
group=conf.SHARED_CONF_GROUP)
self.override_config('vxflexos_storage_pools',
override='PD1:SP1',
group=conf.SHARED_CONF_GROUP)

View File

@ -77,51 +77,6 @@ class TestCreateVolume(vxflexos.TestVxFlexOSDriver):
},
}
def test_no_domain(self):
"""No protection domain name or ID provided."""
self.driver.configuration.sio_protection_domain_name = None
self.driver.configuration.sio_protection_domain_id = None
self.driver.storage_pools = None
self.volume.host = "host@backend"
self.assertRaises(exception.VolumeBackendAPIException,
self.test_create_volume)
def test_no_domain_id(self):
"""Only protection domain name provided."""
self.driver.protection_domain_id = None
self.driver.protection_domain_name = self.PROT_DOMAIN_NAME
self.driver.storage_pool_name = None
self.driver.storage_pool_id = self.STORAGE_POOL_ID
self.test_create_volume()
def test_no_domain_id_invalid_response(self):
self.set_https_response_mode(self.RESPONSE_MODE.Invalid)
self.assertRaises(exception.VolumeBackendAPIException,
self.test_no_domain_id)
def test_no_domain_id_badstatus_response(self):
self.set_https_response_mode(self.RESPONSE_MODE.BadStatus)
self.assertRaises(exception.VolumeBackendAPIException,
self.test_no_domain_id)
def test_no_storage_id(self):
"""Only protection domain name provided."""
self.driver.storage_pool_id = None
self.driver.storage_pool_name = self.STORAGE_POOL_NAME
self.driver.protection_domain_id = self.PROT_DOMAIN_ID
self.driver.protection_domain_name = None
self.test_create_volume()
def test_no_storage_id_invalid_response(self):
self.set_https_response_mode(self.RESPONSE_MODE.Invalid)
self.assertRaises(exception.VolumeBackendAPIException,
self.test_no_storage_id)
def test_no_storage_id_badstatus_response(self):
self.set_https_response_mode(self.RESPONSE_MODE.BadStatus)
self.assertRaises(exception.VolumeBackendAPIException,
self.test_no_storage_id)
def test_create_volume(self):
"""Valid create volume parameters"""
self.driver.create_volume(self.volume)

View File

@ -47,22 +47,6 @@ class TestInitializeConnection(vxflexos.TestVxFlexOSDriver):
self.assertIsNone(connection_properties['iopsLimit'])
self.assertIsNone(connection_properties['bandwidthLimit'])
def test_only_extraspecs(self):
qos = {}
extraspecs = {'sio:iops_limit': 2000, 'sio:bandwidth_limit': 4096}
connection_properties = (
self._initialize_connection(qos, extraspecs)['data'])
self.assertEqual(2000, int(connection_properties['iopsLimit']))
self.assertEqual(4096, int(connection_properties['bandwidthLimit']))
def test_qos_and_extraspecs(self):
qos = {'maxIOPS': 1000, 'maxBWS': 3072}
extraspecs = {'sio:iops_limit': 2000, 'sio:bandwidth_limit': 4000}
connection_properties = (
self._initialize_connection(qos, extraspecs)['data'])
self.assertEqual(1000, int(connection_properties['iopsLimit']))
self.assertEqual(3072, int(connection_properties['bandwidthLimit']))
def test_qos_scaling_and_max(self):
qos = {'maxIOPS': 100, 'maxBWS': 2048, 'maxIOPSperGB': 10,
'maxBWSperGB': 128}
@ -104,7 +88,7 @@ class TestInitializeConnection(vxflexos.TestVxFlexOSDriver):
def test_vol_id(self):
extraspecs = qos = {}
connection_properties = (
self._initialize_connection(extraspecs, qos)['data'])
self._initialize_connection(qos, extraspecs)['data'])
self.assertEqual(fake.PROVIDER_ID,
connection_properties['scaleIO_volume_id'])

View File

@ -114,46 +114,20 @@ class TestMisc(vxflexos.TestVxFlexOSDriver):
def test_valid_configuration(self):
self.driver.check_for_setup_error()
def test_both_storage_pool(self):
"""Both storage name and ID provided.
INVALID
"""
self.driver.configuration.sio_storage_pool_id = self.STORAGE_POOL_ID
self.driver.configuration.sio_storage_pool_name = (
self.STORAGE_POOL_NAME
)
self.assertRaises(exception.InvalidInput,
self.driver.check_for_setup_error)
def test_no_storage_pool(self):
"""No storage name or ID provided.
VALID as storage_pools are defined
"""
self.driver.configuration.sio_storage_pool_name = None
self.driver.configuration.sio_storage_pool_id = None
self.driver.check_for_setup_error()
def test_both_domain(self):
"""Both domain and ID are provided
INVALID
"""
self.driver.configuration.sio_protection_domain_name = (
self.PROT_DOMAIN_NAME)
self.driver.configuration.sio_protection_domain_id = (
self.PROT_DOMAIN_ID)
self.assertRaises(exception.InvalidInput,
self.driver.check_for_setup_error)
def test_no_storage_pools(self):
"""No storage pools.
VALID as domain and storage pool names are provided
INVALID Storage pools must be set
"""
self.driver.storage_pools = None
self.driver.check_for_setup_error()
self.assertRaises(exception.InvalidInput,
self.driver.check_for_setup_error)
def test_invalid_storage_pools(self):
"""Invalid storage pools data"""
self.driver.storage_pools = "test"
self.assertRaises(exception.InvalidInput,
self.driver.check_for_setup_error)
def test_volume_size_round_true(self):
self.driver._check_volume_size(1)

View File

@ -59,14 +59,7 @@ CONF.register_opts(vxflexos_opts, group=configuration.SHARED_CONF_GROUP)
LOG = logging.getLogger(__name__)
STORAGE_POOL_NAME = 'sio:sp_name'
STORAGE_POOL_ID = 'sio:sp_id'
PROTECTION_DOMAIN_NAME = 'sio:pd_name'
PROTECTION_DOMAIN_ID = 'sio:pd_id'
PROVISIONING_KEY = 'provisioning:type'
OLD_PROVISIONING_KEY = 'sio:provisioning_type'
IOPS_LIMIT_KEY = 'sio:iops_limit'
BANDWIDTH_LIMIT = 'sio:bandwidth_limit'
QOS_IOPS_LIMIT_KEY = 'maxIOPS'
QOS_BANDWIDTH_LIMIT = 'maxBWS'
QOS_IOPS_PER_GB = 'maxIOPSperGB'
@ -140,8 +133,6 @@ class VxFlexOSDriver(driver.VolumeDriver):
'port': self.server_port,
'user': self.server_username,
'verify_cert': self.verify_server_certificate})
# starting in Pike, prefer the sio_storage_pools option
self.storage_pools = None
if self.configuration.vxflexos_storage_pools:
self.storage_pools = [
@ -150,15 +141,6 @@ class VxFlexOSDriver(driver.VolumeDriver):
LOG.info("Storage pools names: %(pools)s.",
{'pools': self.storage_pools})
LOG.info("Storage pool name: %(pool)s, pool id: %(pool_id)s.",
{'pool': self.configuration.sio_storage_pool_name,
'pool_id': self.configuration.sio_storage_pool_id})
LOG.info("Protection domain name: %(domain)s, "
"domain id: %(domain_id)s.",
{'domain': self.configuration.sio_protection_domain_name,
'domain_id': self.configuration.sio_protection_domain_id})
self.provisioning_type = (
'thin' if self.configuration.san_thin_provision else 'thick')
LOG.info("Default provisioning type: %(provisioning_type)s.",
@ -187,20 +169,6 @@ class VxFlexOSDriver(driver.VolumeDriver):
return vxflexos_opts
def check_for_setup_error(self):
# make sure both domain name and id are not specified
if (self.configuration.sio_protection_domain_name
and self.configuration.sio_protection_domain_id):
msg = _("Cannot specify both protection domain name "
"and protection domain id.")
raise exception.InvalidInput(reason=msg)
# make sure both storage pool and id are not specified
if (self.configuration.sio_storage_pool_name
and self.configuration.sio_storage_pool_id):
msg = _("Cannot specify both storage pool name and storage "
"pool id.")
raise exception.InvalidInput(reason=msg)
# make sure the REST gateway is specified
if not self.server_ip:
msg = _("REST server IP must be specified.")
@ -246,8 +214,6 @@ class VxFlexOSDriver(driver.VolumeDriver):
"removed in a future version"))
versionutils.report_deprecated_feature(LOG, msg)
# we have enough information now to validate pools
self.storage_pools = self._build_storage_pool_list()
if not self.storage_pools:
msg = (_("Must specify storage pools. Option: "
"vxflexos_storage_pools."))
@ -281,41 +247,6 @@ class VxFlexOSDriver(driver.VolumeDriver):
"and prevent this from occurring.",
pool)
def _build_storage_pool_list(self):
"""Build storage pool list
This method determines the list of storage pools that
are requested, by concatenating a few config settings
"""
# start with the list of pools supplied in the configuration
pools = self.storage_pools
# append the domain:pool specified individually
if (self.configuration.sio_storage_pool_name is not None and
self.configuration.sio_protection_domain_name is not None):
extra_pool = "{}:{}".format(
self.configuration.sio_protection_domain_name,
self.configuration.sio_storage_pool_name)
LOG.info("Ensuring %s is in the list of configured pools.",
extra_pool)
if pools is None:
pools = []
if extra_pool not in pools:
pools.append(extra_pool)
# if specified, account for the storage_pool_id
if self.configuration.sio_storage_pool_id is not None:
# the user specified a storage pool id
# get the domain and pool names from SIO
extra_pool = self._get_storage_pool_name(
self.configuration.sio_storage_pool_id)
LOG.info("Ensuring %s is in the list of configured pools.",
extra_pool)
if pools is None:
pools = []
if extra_pool not in pools:
pools.append(extra_pool)
return pools
def _get_queryable_statistics(self, sio_type, sio_id):
if self.statisticProperties is None:
self.statisticProperties = [
@ -350,48 +281,8 @@ class VxFlexOSDriver(driver.VolumeDriver):
return self.statisticProperties
def _find_storage_pool_id_from_storage_type(self, storage_type):
# Default to what was configured in configuration file if not defined.
return storage_type.get(STORAGE_POOL_ID)
def _find_storage_pool_name_from_storage_type(self, storage_type):
pool_name = storage_type.get(STORAGE_POOL_NAME)
# using the extra spec of sio:sp_name is deprecated
if pool_name is not None:
LOG.warning("Using the volume type extra spec of "
"sio:sp_name is deprecated and will be removed "
"in a future version. The supported way to "
"specify this is by specifying an extra spec "
"of 'pool_name=protection_domain:storage_pool'")
return pool_name
def _find_protection_domain_id_from_storage_type(self, storage_type):
# Default to what was configured in configuration file if not defined.
return storage_type.get(PROTECTION_DOMAIN_ID)
def _find_protection_domain_name_from_storage_type(self, storage_type):
domain_name = storage_type.get(PROTECTION_DOMAIN_NAME)
# using the extra spec of sio:pd_name is deprecated
if domain_name is not None:
LOG.warning("Using the volume type extra spec of "
"sio:pd_name is deprecated and will be removed "
"in a future version. The supported way to "
"specify this is by specifying an extra spec "
"of 'pool_name=protection_domain:storage_pool'")
return domain_name
def _find_provisioning_type(self, storage_type):
new_provisioning_type = storage_type.get(PROVISIONING_KEY)
old_provisioning_type = storage_type.get(OLD_PROVISIONING_KEY)
if new_provisioning_type is None and old_provisioning_type is not None:
LOG.info("Using sio:provisioning_type for defining "
"thin or thick volume will be deprecated in the "
"Ocata release of OpenStack. Please use "
"provisioning:type configuration option.")
provisioning_type = old_provisioning_type
else:
provisioning_type = new_provisioning_type
provisioning_type = storage_type.get(PROVISIONING_KEY)
if provisioning_type is not None:
if provisioning_type not in ('thick', 'thin'):
msg = _("Illegal provisioning type. The supported "
@ -401,21 +292,6 @@ class VxFlexOSDriver(driver.VolumeDriver):
else:
return self.provisioning_type
@staticmethod
def _find_limit(storage_type, qos_key, extraspecs_key):
qos_limit = (storage_type.get(qos_key)
if qos_key is not None else None)
extraspecs_limit = (storage_type.get(extraspecs_key)
if extraspecs_key is not None else None)
if extraspecs_limit is not None:
if qos_limit is not None:
LOG.warning("QoS specs are overriding extra_specs.")
else:
LOG.info("Using extra_specs for defining QoS specs "
"will be deprecated in the N release "
"of OpenStack. Please use QoS specs.")
return qos_limit if qos_limit is not None else extraspecs_limit
@staticmethod
def _version_greater_than(ver1, ver2):
return version.LooseVersion(ver1) > version.LooseVersion(ver2)
@ -481,65 +357,18 @@ class VxFlexOSDriver(driver.VolumeDriver):
volname = self._id_to_base64(volume.id)
# the cinder scheduler will send us the pd:sp for the volume
requested_pd = None
requested_sp = None
try:
pd_sp = volume_utils.extract_host(volume.host, 'pool')
if pd_sp is not None:
requested_pd = pd_sp.split(':')[0]
requested_sp = pd_sp.split(':')[1]
except (KeyError, ValueError):
# we seem to have not gotten it so we'll figure out defaults
requested_pd = None
requested_sp = None
pd_sp = volume_utils.extract_host(volume.host, 'pool')
protection_domain_name = pd_sp.split(':')[0]
storage_pool_name = pd_sp.split(':')[1]
storage_type = self._get_volumetype_extraspecs(volume)
type_sp = self._find_storage_pool_name_from_storage_type(storage_type)
storage_pool_id = self._find_storage_pool_id_from_storage_type(
storage_type)
protection_domain_id = (
self._find_protection_domain_id_from_storage_type(storage_type))
type_pd = (
self._find_protection_domain_name_from_storage_type(storage_type))
provisioning_type = self._find_provisioning_type(storage_type)
if type_sp is not None:
# prefer the storage pool in the volume type
# this was undocumented so will likely not happen
storage_pool_name = type_sp
else:
storage_pool_name = requested_sp
if type_pd is not None:
# prefer the protection domain in the volume type
# this was undocumented so will likely not happen
protection_domain_name = type_pd
else:
protection_domain_name = requested_pd
# check if the requested pd:sp match the ones that will
# be used. If not, spit out a deprecation notice
# should never happen
if (protection_domain_name != requested_pd
or storage_pool_name != requested_sp):
LOG.warning(
"Creating volume in different protection domain or "
"storage pool than scheduler requested. "
"Requested: %(req_pd)s:%(req_sp)s, "
"Actual %(act_pd)s:%(act_sp)s.",
{'req_pd': requested_pd,
'req_sp': requested_sp,
'act_pd': protection_domain_name,
'act_sp': storage_pool_name})
LOG.info("Volume type: %(volume_type)s, "
"storage pool name: %(pool_name)s, "
"storage pool id: %(pool_id)s, protection domain id: "
"%(domain_id)s, protection domain name: %(domain_name)s.",
"protection domain name: %(domain_name)s.",
{'volume_type': storage_type,
'pool_name': storage_pool_name,
'pool_id': storage_pool_id,
'domain_id': protection_domain_id,
'domain_name': protection_domain_name})
domain_id = self._get_protection_domain_id(protection_domain_name)
@ -930,15 +759,13 @@ class VxFlexOSDriver(driver.VolumeDriver):
def _get_bandwidth_limit(self, size, storage_type):
try:
max_bandwidth = self._find_limit(storage_type, QOS_BANDWIDTH_LIMIT,
BANDWIDTH_LIMIT)
max_bandwidth = storage_type.get(QOS_BANDWIDTH_LIMIT)
if max_bandwidth is not None:
max_bandwidth = (self._round_to_num_gran(int(max_bandwidth),
units.Ki))
max_bandwidth = six.text_type(max_bandwidth)
LOG.info("max bandwidth is: %s", max_bandwidth)
bw_per_gb = self._find_limit(storage_type, QOS_BANDWIDTH_PER_GB,
None)
bw_per_gb = storage_type.get(QOS_BANDWIDTH_PER_GB)
LOG.info("bandwidth per gb is: %s", bw_per_gb)
if bw_per_gb is None:
return max_bandwidth
@ -957,10 +784,9 @@ class VxFlexOSDriver(driver.VolumeDriver):
raise exception.InvalidInput(reason=msg)
def _get_iops_limit(self, size, storage_type):
max_iops = self._find_limit(storage_type, QOS_IOPS_LIMIT_KEY,
IOPS_LIMIT_KEY)
max_iops = storage_type.get(QOS_IOPS_LIMIT_KEY)
LOG.info("max iops is: %s", max_iops)
iops_per_gb = self._find_limit(storage_type, QOS_IOPS_PER_GB, None)
iops_per_gb = storage_type.get(QOS_IOPS_PER_GB)
LOG.info("iops per gb is: %s", iops_per_gb)
try:
if iops_per_gb is None:

View File

@ -26,10 +26,6 @@ SIO_SERVER_CERTIFICATE_PATH = "sio_server_certificate_path"
SIO_ROUND_VOLUME_CAPACITY = "sio_round_volume_capacity"
SIO_UNMAP_VOLUME_BEFORE_DELETION = "sio_unmap_volume_before_deletion"
SIO_STORAGE_POOLS = "sio_storage_pools"
SIO_PROTECTION_DOMAIN_ID = "sio_protection_domain_id"
SIO_PROTECTION_DOMAIN_NAME = "sio_protection_domain_name"
SIO_STORAGE_POOL_NAME = "sio_storage_pool_name"
SIO_STORAGE_POOL_ID = "sio_storage_pool_id"
SIO_SERVER_API_VERSION = "sio_server_api_version"
SIO_MAX_OVER_SUBSCRIPTION_RATIO = "sio_max_over_subscription_ratio"
SIO_ALLOW_NON_PADDED_VOLUMES = "sio_allow_non_padded_volumes"
@ -80,34 +76,6 @@ deprecated_opts = [
deprecated_for_removal=True,
deprecated_reason='Replaced by %s.' %
VXFLEXOS_STORAGE_POOLS),
cfg.StrOpt(SIO_PROTECTION_DOMAIN_ID,
deprecated_for_removal=True,
deprecated_reason="Replaced by %s option" %
VXFLEXOS_STORAGE_POOLS,
deprecated_since="Pike",
help='Protection Domain ID. '
'Deprecated, use %s instead. ' % VXFLEXOS_STORAGE_POOLS),
cfg.StrOpt(SIO_PROTECTION_DOMAIN_NAME,
deprecated_for_removal=True,
deprecated_reason="Replaced by %s option" %
VXFLEXOS_STORAGE_POOLS,
deprecated_since="Pike",
help='Protection Domain Name. '
'Deprecated, use %s instead. ' % VXFLEXOS_STORAGE_POOLS),
cfg.StrOpt(SIO_STORAGE_POOL_NAME,
deprecated_for_removal=True,
deprecated_reason="Replaced by %s option" %
VXFLEXOS_STORAGE_POOLS,
deprecated_since="Pike",
help='Storage Pool name. '
'Deprecated, use %s instead. ' % VXFLEXOS_STORAGE_POOLS),
cfg.StrOpt(SIO_STORAGE_POOL_ID,
deprecated_for_removal=True,
deprecated_reason="Replaced by %s option" %
VXFLEXOS_STORAGE_POOLS,
deprecated_since="Pike",
help='Storage Pool ID.'
'Deprecated, use %s instead. ' % VXFLEXOS_STORAGE_POOLS),
cfg.StrOpt(SIO_SERVER_API_VERSION,
help='renamed to %s.' %
VXFLEXOS_SERVER_API_VERSION,

View File

@ -0,0 +1,16 @@
---
upgrade:
- |
VxFlex OS (ScaleIO) driver drops support for options, which
were marked as deprecated in Pike release.
Remove config options: ``sio_protection_domain_id``,
``sio_protection_domain_name``,
``sio_storage_pool_name``,
``sio_storage_pool_id``.
Remove volume type options: ``sio:sp_name``,
``sio:sp_id``,
``sio:pd_name``,
``sio:pd_id``,
``sio:provisioning_type``,
``sio:iops_limit``,
``sio:bandwidth_limit``.