]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix the iSER legacy usage in the new targets flow
authorAviram Bar-Haim <aviramb@mellanox.com>
Fri, 16 Jan 2015 00:45:30 +0000 (02:45 +0200)
committerAviram Bar-Haim <aviramb@mellanox.com>
Sun, 18 Jan 2015 11:25:14 +0000 (13:25 +0200)
The iSER driver flow, after setting volume_driver to LVMISERDriver,
is broken in the new driver - target model in the master,
due to a mismatch in the target prefixes and a lack of iSER target
initialization, with the correct parameters.

In order to fix this:
  1. The function initialize_connection, that sets the iSER required
     parameters, was added to cinder/volume/targets/iser.py (and overrides the
     new connection initialization in cinder/volume/targets/tgt.py).
  2. The iSER and iSCSI prefixes equalized, due to the removal of brick/iscsi
     with the different default prefix for ISERTgtAdm (and for stability).

Closes-Bug:#1411470

Change-Id: Ie4b9b85b47e9da20a1de1e10415766413cd01f04

cinder/volume/driver.py
cinder/volume/targets/iser.py

index 78f13885db1c847376f7010a25a47cfd48360ec8..2b690fd8860b1b3d5683cef191d7e56e33f03219 100644 (file)
@@ -141,7 +141,7 @@ iser_opts = [
                default=100,
                help='The maximum number of iSER target IDs per host'),
     cfg.StrOpt('iser_target_prefix',
-               default='iqn.2010-10.org.iser.openstack:',
+               default='iqn.2010-10.org.openstack:',
                help='Prefix for iSER volumes'),
     cfg.StrOpt('iser_ip_address',
                default='$my_ip',
index ec730d605cebb496001582a3a55536cca3e9d2a7..2a41f504c2069572590596895ab3504f82880fd0 100644 (file)
@@ -52,3 +52,25 @@ class ISERTgtAdm(TgtAdm):
         self.configuration.iscsi_ip_address = \
             self.configuration.iser_ip_address
         self.configuration.iscsi_port = self.configuration.iser_port
+
+    def initialize_connection(self, volume, connector):
+        """Initializes the connection and returns connection info.
+        The iser driver returns a driver_volume_type of 'iser'.
+        The format of the driver data is defined in _get_iscsi_properties.
+        Example return value::
+            {
+                'driver_volume_type': 'iser'
+                'data': {
+                    'target_discovered': True,
+                    'target_iqn':
+                    'iqn.2010-10.org.iser.openstack:volume-00000001',
+                    'target_portal': '127.0.0.0.1:3260',
+                    'volume_id': 1,
+                }
+            }
+        """
+        iser_properties = self._get_iscsi_properties(volume)
+        return {
+            'driver_volume_type': 'iser',
+            'data': iser_properties
+        }