Merge "Dell EMC: Added excluded_domain_ips ListOpt to SC driver"

This commit is contained in:
Zuul 2018-08-28 16:07:49 +00:00 committed by Gerrit Code Review
commit 7ca50774c7
9 changed files with 165 additions and 16 deletions

View File

@ -143,6 +143,8 @@ class DellSCSanFCDriverTestCase(test.TestCase):
self.configuration.dell_sc_server_folder = 'opnstktst'
self.configuration.dell_sc_volume_folder = 'opnstktst'
self.configuration.dell_sc_api_port = 3033
self.configuration.excluded_domain_ip = None
self.configuration.excluded_domain_ips = []
self._context = context.get_admin_context()
self.driver = storagecenter_fc.SCFCDriver(

View File

@ -226,6 +226,8 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
self.configuration.dell_sc_api_port = 3033
self.configuration.target_ip_address = '192.168.1.1'
self.configuration.target_port = 3260
self.configuration.excluded_domain_ip = None
self.configuration.excluded_domain_ips = []
self._context = context.get_admin_context()
self.driver = storagecenter_iscsi.SCISCSIDriver(

View File

@ -9027,6 +9027,112 @@ class DellStorageCenterApiHelperTestCase(test.TestCase):
self.assertEqual('FibreChannel', ret.protocol)
mock_open_connection.assert_called_once_with()
@mock.patch.object(storagecenter_api.SCApi,
'open_connection')
def test_setup_connection_excluded1(self,
mock_open_connection):
config = mock.MagicMock()
config.dell_sc_ssn = 12345
config.san_ip = '192.168.0.101'
config.san_login = 'username'
config.san_password = 'password'
config.dell_sc_volume_folder = 'a'
config.dell_sc_server_folder = 'a'
config.dell_sc_verify_cert = False
config.san_port = 3033
config.excluded_domain_ip = ['192.168.0.1']
config.excluded_domain_ips = ['192.168.0.2', '192.168.0.3']
helper = storagecenter_api.SCApiHelper(config, None, 'FC')
ret = helper._setup_connection()
self.assertEqual(set(ret.excluded_domain_ips), set(['192.168.0.2',
'192.168.0.3', '192.168.0.1']))
self.assertEqual(12345, ret.primaryssn)
self.assertEqual(12345, ret.ssn)
self.assertEqual('FibreChannel', ret.protocol)
mock_open_connection.assert_called_once_with()
@mock.patch.object(storagecenter_api.SCApi,
'open_connection')
def test_setup_connection_excluded2(self,
mock_open_connection):
config = mock.MagicMock()
config.dell_sc_ssn = 12345
config.san_ip = '192.168.0.101'
config.san_login = 'username'
config.san_password = 'password'
config.dell_sc_volume_folder = 'a'
config.dell_sc_server_folder = 'a'
config.dell_sc_verify_cert = False
config.san_port = 3033
config.excluded_domain_ip = None
config.excluded_domain_ips = ['192.168.0.2', '192.168.0.3']
helper = storagecenter_api.SCApiHelper(config, None, 'FC')
ret = helper._setup_connection()
self.assertEqual(set(ret.excluded_domain_ips), set(['192.168.0.2',
'192.168.0.3']))
@mock.patch.object(storagecenter_api.SCApi,
'open_connection')
def test_setup_connection_excluded3(self,
mock_open_connection):
config = mock.MagicMock()
config.dell_sc_ssn = 12345
config.san_ip = '192.168.0.101'
config.san_login = 'username'
config.san_password = 'password'
config.dell_sc_volume_folder = 'a'
config.dell_sc_server_folder = 'a'
config.dell_sc_verify_cert = False
config.san_port = 3033
config.excluded_domain_ip = ['192.168.0.1']
config.excluded_domain_ips = []
helper = storagecenter_api.SCApiHelper(config, None, 'FC')
ret = helper._setup_connection()
self.assertEqual(ret.excluded_domain_ips, ['192.168.0.1'])
@mock.patch.object(storagecenter_api.SCApi,
'open_connection')
def test_setup_connection_excluded4(self,
mock_open_connection):
config = mock.MagicMock()
config.dell_sc_ssn = 12345
config.san_ip = '192.168.0.101'
config.san_login = 'username'
config.san_password = 'password'
config.dell_sc_volume_folder = 'a'
config.dell_sc_server_folder = 'a'
config.dell_sc_verify_cert = False
config.san_port = 3033
config.excluded_domain_ip = None
config.excluded_domain_ips = []
helper = storagecenter_api.SCApiHelper(config, None, 'FC')
ret = helper._setup_connection()
self.assertEqual(ret.excluded_domain_ips, [])
@mock.patch.object(storagecenter_api.SCApi,
'open_connection')
def test_setup_connection_excluded5(self,
mock_open_connection):
config = mock.MagicMock()
config.dell_sc_ssn = 12345
config.san_ip = '192.168.0.101'
config.san_login = 'username'
config.san_password = 'password'
config.dell_sc_volume_folder = 'a'
config.dell_sc_server_folder = 'a'
config.dell_sc_verify_cert = False
config.san_port = 3033
config.excluded_domain_ip = ['192.168.0.1']
config.excluded_domain_ips = ['192.168.0.1', '192.168.0.2']
helper = storagecenter_api.SCApiHelper(config, None, 'FC')
ret = helper._setup_connection()
self.assertEqual(set(ret.excluded_domain_ips), set(['192.168.0.2',
'192.168.0.1']))
self.assertEqual(12345, ret.primaryssn)
self.assertEqual(12345, ret.ssn)
self.assertEqual('FibreChannel', ret.protocol)
mock_open_connection.assert_called_once_with()
@mock.patch.object(storagecenter_api.SCApi,
'open_connection')
def test_setup_connection_iscsi(self,

View File

@ -356,9 +356,17 @@ class SCApiHelper(object):
# about.
connection.vfname = self.config.dell_sc_volume_folder
connection.sfname = self.config.dell_sc_server_folder
connection.excluded_domain_ips = self.config.excluded_domain_ip
if not connection.excluded_domain_ips:
connection.excluded_domain_ips = []
connection.excluded_domain_ips = self.config.excluded_domain_ips
if self.config.excluded_domain_ip:
LOG.info("Using excluded_domain_ip for "
"excluding domain IPs is deprecated in the "
"Stein release of OpenStack. Please use the "
"excluded_domain_ips configuration option.")
connection.excluded_domain_ips += self.config.excluded_domain_ip
# Remove duplicates
connection.excluded_domain_ips = list(set(
connection.excluded_domain_ips))
# Our primary SSN doesn't change
connection.primaryssn = self.primaryssn
if self.storage_protocol == 'FC':
@ -435,10 +443,11 @@ class SCApi(object):
3.7.0 - Support for Data Reduction, Group QOS and Volume QOS.
4.0.0 - Driver moved to dell_emc.
4.1.0 - Timeouts added to rest calls.
4.1.1 - excluded_domain_ips support.
"""
APIDRIVERVERSION = '4.1.0'
APIDRIVERVERSION = '4.1.1'
def __init__(self, host, port, user, password, verify,
asynctimeout, synctimeout, apiversion):

View File

@ -67,7 +67,16 @@ common_opts = [
cfg.MultiOpt('excluded_domain_ip',
item_type=types.IPAddress(),
default=None,
help='Domain IP to be excluded from iSCSI returns.'),
deprecated_for_removal=True,
deprecated_reason="Replaced by excluded_domain_ips option",
deprecated_since="Stein",
help='DEPRECATED: Fault Domain IP to be excluded from '
'iSCSI returns.'),
cfg.ListOpt('excluded_domain_ips',
item_type=types.IPAddress(),
default=[],
help='Comma separated Fault Domain IPs to be excluded '
'from iSCSI returns.'),
cfg.StrOpt('dell_server_os',
default='Red Hat Linux 6.x',
help='Server OS type to use when creating a new server on the '

View File

@ -63,10 +63,11 @@ class SCFCDriver(storagecenter_common.SCCommonDriver,
3.7.0 - Support for Data Reduction, Group QOS and Volume QOS.
4.0.0 - Driver moved to dell_emc.
4.1.0 - Timeouts added to rest calls.
4.1.1 - excluded_domain_ips support.
"""
VERSION = '4.1.0'
VERSION = '4.1.1'
CI_WIKI_NAME = "Dell_EMC_SC_Series_CI"

View File

@ -63,10 +63,11 @@ class SCISCSIDriver(storagecenter_common.SCCommonDriver,
3.7.0 - Support for Data Reduction, Group QOS and Volume QOS.
4.0.0 - Driver moved to dell_emc.
4.1.0 - Timeouts added to rest calls.
4.1.1 - excluded_domain_ips support.
"""
VERSION = '4.1.0'
VERSION = '4.1.1'
CI_WIKI_NAME = "Dell_EMC_SC_Series_CI"
def __init__(self, *args, **kwargs):

View File

@ -353,14 +353,14 @@ not have to match the actual OS used on the node.
Excluding a domain
~~~~~~~~~~~~~~~~~~
This option excludes a Storage Center ISCSI fault domain from the ISCSI
properties returned by the initialize_connection call. This only applies to
the ISCSI driver.
This option excludes a list of Storage Center ISCSI fault domains from
the ISCSI properties returned by the initialize_connection call. This
only applies to the ISCSI driver.
Add the excluded_domain_ip option into the backend config for each fault domain
to be excluded. This option takes the specified Target IPv4 Address listed
under the fault domain. Older versions of DSM (EM) may list this as the Well
Known IP Address.
Add the excluded_domain_ips option into the backend config for several fault
domains to be excluded. This option takes a comma separated list of Target
IPv4 Addresses listed under the fault domain. Older versions of DSM (EM) may
list this as the Well Known IP Address.
Add the following to the back-end specification to exclude the domains at
172.20.25.15 and 172.20.26.15.
@ -368,8 +368,9 @@ Add the following to the back-end specification to exclude the domains at
.. code-block:: ini
[dell]
excluded_domain_ip=172.20.25.15
excluded_domain_ip=172.20.26.15
excluded_domain_ips=172.20.25.15, 172.20.26.15
Setting Dell EMC SC REST API timeouts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -0,0 +1,18 @@
---
features:
- Added an ``excluded_domain_ips`` option to the Dell EMC SC driver. This
is identical to the excluded_domain_ip option only comma separated
rather than multiple entry. This is concatenated with the
``excluded_domain_ip`` option.
deprecations:
- |
The Dell EMC SC configuration option ``excluded_domain_ip`` has
been deprecated and will be removed in a future release. Deployments should
now migrate to the option ``excluded_domain_ips`` for equivalent
functionality.
upgrade:
- |
The Dell EMC SC configuration option ``excluded_domain_ip`` has
been deprecated and will be removed in a future release. Deployments should
now migrate to the option ``excluded_domain_ips`` for equivalent
functionality.