]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Deprecate *_multipath_enabled flag for IBM drivers
authorRyan McNair <rdmcnair@us.ibm.com>
Thu, 12 Nov 2015 15:06:32 +0000 (15:06 +0000)
committerRyan McNair <rdmcnair@us.ibm.com>
Fri, 20 Nov 2015 17:36:08 +0000 (17:36 +0000)
Deprecate the *_multipath_enabled from the FlashSystem and
Storwize/SVC driver. When enabled, this flag was intended to create
a single mapping between the compute node and the storage device for
FC connections. However, all available storage WWNNs were still being
mapped to the compute node, and instead enabling this flag was
causing a terminate_connection to not cleanup all LUN mappings
(because Nova did not know of all the target_wwns that were actually
mapped). This can be seen by enabling the flag, connecting a volume,
disconnecting the volume and observing the stray LUN mappings under
'/dev/disk/by-path'.

Currently we do not have a way to limit the storage WWNNs which are
mapped during a FC connection, so we will ignore the config to fix
this broken behavior, and then remove the config next release.

DocImpact

Change-Id: I0019c1e0c0dbb0cd48a7f389376480e7fa1b1e07
Closes-Bug: #1516778

cinder/tests/unit/test_ibm_flashsystem.py
cinder/tests/unit/test_ibm_flashsystem_iscsi.py
cinder/tests/unit/test_storwize_svc.py
cinder/volume/drivers/ibm/flashsystem_common.py
cinder/volume/drivers/ibm/flashsystem_fc.py
cinder/volume/drivers/ibm/storwize_svc/__init__.py
cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py

index ef560f2c4a9d2fb9f1e7e0e3e15b875a6201f98d..70b82a8584f3488df9a7dc5593efd623ebd2bfbe 100644 (file)
@@ -723,7 +723,6 @@ class FlashSystemDriverTestCase(test.TestCase):
                            'san_login': 'username',
                            'san_password': 'password',
                            'flashsystem_connection_protocol': 'FC',
-                           'flashsystem_multipath_enabled': False,
                            'flashsystem_multihostmap_enabled': True}
 
         self.connector = {
index 1d82edd9c3149f82f45c6f12fcc52f4364db3381..31b625ae99864e1c87ea450ebd92d9eb1cb5043f 100644 (file)
@@ -116,7 +116,6 @@ class FlashSystemISCSIDriverTestCase(test.TestCase):
                            'san_login': 'username',
                            'san_password': 'password',
                            'flashsystem_connection_protocol': 'iSCSI',
-                           'flashsystem_multipath_enabled': False,
                            'flashsystem_multihostmap_enabled': True,
                            'iscsi_ip_address': '192.168.1.10',
                            'flashsystem_iscsi_portid': 1}
index 76af4863ad7d3f87e90418135344ed053da6f632..5c43a9382fb248db93f51d23ddff7949307ac140 100644 (file)
@@ -1745,7 +1745,6 @@ class StorwizeSVCDriverTestCase(test.TestCase):
                                'storwize_svc_flashcopy_timeout': 20,
                                # Test ignore capitalization
                                'storwize_svc_connection_protocol': 'iScSi',
-                               'storwize_svc_multipath_enabled': False,
                                'storwize_svc_allow_tenant_qos': True}
             wwpns = [str(random.randint(0, 9999999999999999)).zfill(16),
                      str(random.randint(0, 9999999999999999)).zfill(16)]
@@ -1767,7 +1766,6 @@ class StorwizeSVCDriverTestCase(test.TestCase):
                                'storwize_svc_volpool_name': 'openstack',
                                # Test ignore capitalization
                                'storwize_svc_connection_protocol': 'iScSi',
-                               'storwize_svc_multipath_enabled': False,
                                'storwize_svc_allow_tenant_qos': True,
                                'ssh_conn_timeout': 0}
             config_group = self.driver.configuration.config_group
@@ -1947,7 +1945,6 @@ class StorwizeSVCDriverTestCase(test.TestCase):
                'compression': False,
                'easytier': True,
                'protocol': 'iSCSI',
-               'multipath': False,
                'iogrp': 0,
                'qos': None,
                'replication': False,
@@ -2340,7 +2337,7 @@ class StorwizeSVCDriverTestCase(test.TestCase):
 
         expected = {'FC': {'driver_volume_type': 'fibre_channel',
                            'data': {'target_lun': 0,
-                                    'target_wwn': 'AABBCCDDEEFF0011',
+                                    'target_wwn': ['AABBCCDDEEFF0011'],
                                     'target_discovered': False}},
                     'iSCSI': {'driver_volume_type': 'iscsi',
                               'data': {'target_discovered': False,
@@ -3087,7 +3084,7 @@ class StorwizeSVCDriverTestCase(test.TestCase):
 
         self.assertIsNotNone(host_name)
 
-    def test_storwize_initiator_multiple_preferred_nodes_matching(self):
+    def test_storwize_initiator_multiple_wwpns_connected(self):
 
         # Generate us a test volume
         volume = self._create_volume()
@@ -3110,83 +3107,16 @@ class StorwizeSVCDriverTestCase(test.TestCase):
 
         with mock.patch.object(storwize_svc_common.StorwizeHelpers,
                                'get_conn_fc_wwpns') as get_mappings:
-            get_mappings.return_value = ['AABBCCDDEEFF0001',
-                                         'AABBCCDDEEFF0002',
-                                         'AABBCCDDEEFF0010',
-                                         'AABBCCDDEEFF0012']
+            mapped_wwpns = ['AABBCCDDEEFF0001', 'AABBCCDDEEFF0002',
+                            'AABBCCDDEEFF0010', 'AABBCCDDEEFF0012']
+            get_mappings.return_value = mapped_wwpns
 
             # Initialize the connection
             init_ret = self.driver.initialize_connection(volume, connector)
 
-            # Make sure we use the preferred WWPN.
-            self.assertEqual('AABBCCDDEEFF0010',
-                             init_ret['data']['target_wwn'])
-
-    def test_storwize_initiator_multiple_preferred_nodes_no_matching(self):
-        # Generate us a test volume
-        volume = self._create_volume()
-
-        # Fibre Channel volume type
-        extra_spec = {'capabilities:storage_protocol': '<in> FC'}
-        vol_type = volume_types.create(self.ctxt, 'FC', extra_spec)
-
-        volume['volume_type_id'] = vol_type['id']
-
-        # Make sure that the volumes have been created
-        self._assert_vol_exists(volume['name'], True)
-
-        # Set up WWPNs that will not match what is available.
-        self.driver._state['storage_nodes']['1']['WWPN'] = ['123456789ABCDEF0',
-                                                            '123456789ABCDEF1']
-
-        wwpns = ['ff00000000000000', 'ff00000000000001']
-        connector = {'host': 'storwize-svc-test', 'wwpns': wwpns}
-
-        with mock.patch.object(storwize_svc_common.StorwizeHelpers,
-                               'get_conn_fc_wwpns') as get_mappings:
-            get_mappings.return_value = ['AABBCCDDEEFF0001',
-                                         'AABBCCDDEEFF0002',
-                                         'AABBCCDDEEFF0010',
-                                         'AABBCCDDEEFF0012']
-
-            # Initialize the connection
-            init_ret = self.driver.initialize_connection(volume, connector)
-
-            # Make sure we use the first available WWPN.
-            self.assertEqual('AABBCCDDEEFF0001',
-                             init_ret['data']['target_wwn'])
-
-    def test_storwize_initiator_single_preferred_node_matching(self):
-        # Generate us a test volume
-        volume = self._create_volume()
-
-        # Fibre Channel volume type
-        extra_spec = {'capabilities:storage_protocol': '<in> FC'}
-        vol_type = volume_types.create(self.ctxt, 'FC', extra_spec)
-
-        volume['volume_type_id'] = vol_type['id']
-
-        # Make sure that the volumes have been created
-        self._assert_vol_exists(volume['name'], True)
-
-        # Set up one WWPN.
-        self.driver._state['storage_nodes']['1']['WWPN'] = ['AABBCCDDEEFF0012']
-
-        wwpns = ['ff00000000000000', 'ff00000000000001']
-        connector = {'host': 'storwize-svc-test', 'wwpns': wwpns}
-
-        with mock.patch.object(storwize_svc_common.StorwizeHelpers,
-                               'get_conn_fc_wwpns') as get_mappings:
-            get_mappings.return_value = ['AABBCCDDEEFF0001',
-                                         'AABBCCDDEEFF0002',
-                                         'AABBCCDDEEFF0010',
-                                         'AABBCCDDEEFF0012']
-
-            # Initialize the connection
-            init_ret = self.driver.initialize_connection(volume, connector)
-
-            # Make sure we use the preferred WWPN.
-            self.assertEqual('AABBCCDDEEFF0012',
+            # Make sure we return all wwpns which where mapped as part of the
+            # connection
+            self.assertEqual(mapped_wwpns,
                              init_ret['data']['target_wwn'])
 
     def test_storwize_terminate_connection(self):
@@ -3238,7 +3168,7 @@ class StorwizeSVCDriverTestCase(test.TestCase):
                                'ff00000000000001': ['AABBCCDDEEFF0011']},
                               'target_discovered': False,
                               'target_lun': 0,
-                              'target_wwn': 'AABBCCDDEEFF0011',
+                              'target_wwn': ['AABBCCDDEEFF0011'],
                               'volume_id': volume['id']
                               }
                      }
index 422b6bddc40d34b06604847f56bacf021190e919..bb06e3a5ed8c2a519b64c69f736a93265db51006 100644 (file)
@@ -122,8 +122,7 @@ class FlashSystemDriver(san.SanDriver):
                                 'err': six.text_type(err)}))
 
     def _build_default_params(self):
-        return {'protocol': self.configuration.flashsystem_connection_protocol,
-                'multipath': self.configuration.flashsystem_multipath_enabled}
+        return {'protocol': self.configuration.flashsystem_connection_protocol}
 
     def _build_initiator_target_map(self, initiator_wwpns, target_wwpns):
         map = {}
index 3f0a63cfe1e3c7ad4303796dff0fcf3adc94def1..f941d98c3b00ff3d7a7303c23a06d1fb30d6be98 100644 (file)
@@ -32,7 +32,7 @@ from oslo_utils import excutils
 import six
 
 from cinder import exception
-from cinder.i18n import _, _LE, _LI, _LW
+from cinder.i18n import _, _LE, _LI
 from cinder import utils
 import cinder.volume.driver
 from cinder.volume.drivers.ibm import flashsystem_common as fscommon
@@ -44,8 +44,9 @@ LOG = logging.getLogger(__name__)
 flashsystem_fc_opts = [
     cfg.BoolOpt('flashsystem_multipath_enabled',
                 default=False,
-                help='Connect with multipath (FC only).'
-                     '(Default is false.)')
+                help='This option no longer has any affect. It is deprecated '
+                     'and will be removed in the next release.',
+                deprecated_for_removal=True)
 ]
 
 CONF = cfg.CONF
@@ -187,17 +188,12 @@ class FlashSystemFCDriver(fscommon.FlashSystemDriver,
             'enter: _get_vdisk_map_properties: vdisk '
             '%(vdisk_name)s.', {'vdisk_name': vdisk_name})
 
-        preferred_node = '0'
         IO_group = '0'
 
-        # Get preferred node and other nodes in I/O group
-        preferred_node_entry = None
         io_group_nodes = []
         for k, node in self._storage_nodes.items():
             if vdisk_params['protocol'] != node['protocol']:
                 continue
-            if node['id'] == preferred_node:
-                preferred_node_entry = node
             if node['IO_group'] == IO_group:
                 io_group_nodes.append(node)
 
@@ -208,11 +204,6 @@ class FlashSystemFCDriver(fscommon.FlashSystemDriver,
             LOG.error(msg)
             raise exception.VolumeBackendAPIException(data=msg)
 
-        if not preferred_node_entry and not vdisk_params['multipath']:
-            # Get 1st node in I/O group
-            preferred_node_entry = io_group_nodes[0]
-            LOG.warning(_LW('_get_vdisk_map_properties: Did not find a '
-                            'preferred node for vdisk %s.'), vdisk_name)
         properties = {}
         properties['target_discovered'] = False
         properties['target_lun'] = lun_id
index 9c3e6206654e6a7301e1532337aa664e6fa70c20..f41a7d87bd4d5b97620a79198a66e9a85aaa9a54 100644 (file)
@@ -103,8 +103,9 @@ storwize_svc_opts = [
                      '(Default: Enabled)'),
     cfg.BoolOpt('storwize_svc_multipath_enabled',
                 default=False,
-                help='Connect with multipath (FC only; iSCSI multipath is '
-                     'controlled by Nova)'),
+                help='This option no longer has any affect. It is deprecated '
+                     'and will be removed in the next release.',
+                deprecated_for_removal=True),
     cfg.BoolOpt('storwize_svc_multihostmap_enabled',
                 default=True,
                 help='Allows vdisk to multi host mapping'),
@@ -408,7 +409,7 @@ class StorwizeSVCDriver(san.SanDriver,
                 LOG.error(msg)
                 raise exception.VolumeBackendAPIException(data=msg)
 
-            if not preferred_node_entry and not vol_opts['multipath']:
+            if not preferred_node_entry:
                 # Get 1st node in I/O group
                 preferred_node_entry = io_group_nodes[0]
                 LOG.warning(_LW('initialize_connection: Did not find a '
@@ -445,25 +446,7 @@ class StorwizeSVCDriver(san.SanDriver,
                     for node in self._state['storage_nodes'].values():
                         conn_wwpns.extend(node['WWPN'])
 
-                if not vol_opts['multipath']:
-                    # preferred_node_entry can have a list of WWPNs while only
-                    # one WWPN may be available on the storage host.  Here we
-                    # walk through the nodes until we find one that works,
-                    # default to the first WWPN otherwise.
-                    for WWPN in preferred_node_entry['WWPN']:
-                        if WWPN in conn_wwpns:
-                            properties['target_wwn'] = WWPN
-                            break
-                    else:
-                        LOG.warning(_LW('Unable to find a preferred node match'
-                                        ' for node %(node)s in the list of '
-                                        'available WWPNs on %(host)s. '
-                                        'Using first available.'),
-                                    {'node': preferred_node,
-                                     'host': host_name})
-                        properties['target_wwn'] = conn_wwpns[0]
-                else:
-                    properties['target_wwn'] = conn_wwpns
+                properties['target_wwn'] = conn_wwpns
 
                 i_t_map = self._make_initiator_target_map(connector['wwpns'],
                                                           conn_wwpns)
@@ -854,7 +837,7 @@ class StorwizeSVCDriver(san.SanDriver,
                                                    'diff': diff,
                                                    'host': host})
 
-        ignore_keys = ['protocol', 'multipath']
+        ignore_keys = ['protocol']
         no_copy_keys = ['warning', 'autoexpand', 'easytier']
         copy_keys = ['rsize', 'grainsize', 'compression']
         all_keys = ignore_keys + no_copy_keys + copy_keys
index c7050967d3a1eb0ed1e0282972941dbb2bcaa790..c4370d0a8dc74b4488d668346c85c82917141d43 100644 (file)
@@ -737,7 +737,6 @@ class StorwizeHelpers(object):
                'compression': config.storwize_svc_vol_compression,
                'easytier': config.storwize_svc_vol_easytier,
                'protocol': protocol,
-               'multipath': config.storwize_svc_multipath_enabled,
                'iogrp': config.storwize_svc_vol_iogrp,
                'qos': None,
                'stretched_cluster': cluster_partner,