]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
fixing the iSER transport protocol when using LVMISERDriver
authornuritv <nuritv@mellanox.com>
Mon, 28 Jul 2014 18:50:55 +0000 (21:50 +0300)
committernuritv <nuritv@mellanox.com>
Tue, 29 Jul 2014 07:17:07 +0000 (10:17 +0300)
ISER capabilities were broken in icehouse when trying to remove
duplication between ISCSIDriver and ISERDriver.
this fix does minimal changes in the code in order to fix
the capability.
the fix is basically re-adding the ISERTgtAdm and re-adding
the support in LVMISERDriver: change target_lun based on
iseradm.

Closes-Bug: #1336648
Change-Id: Ic3c9da9577d09d9199218ea82bda56599527223c

cinder/volume/driver.py
cinder/volume/iscsi.py

index 086d430cf3360b30235919309fa02802be728cfb..20d290bc0ad95167fd3c170ea116e89931a4ad86 100644 (file)
@@ -185,7 +185,7 @@ class VolumeDriver(object):
 
         if self.configuration:
             self.configuration.append_config_values(volume_opts)
-
+            self.configuration.append_config_values(iser_opts)
         self.set_execute(execute)
         self._stats = {}
 
@@ -759,8 +759,9 @@ class ISCSIDriver(VolumeDriver):
         except (IndexError, ValueError):
             if (self.configuration.volume_driver in
                     ['cinder.volume.drivers.lvm.LVMISCSIDriver',
+                     'cinder.volume.drivers.lvm.LVMISERDriver',
                      'cinder.volume.drivers.lvm.ThinLVMVolumeDriver'] and
-                    self.configuration.iscsi_helper == 'tgtadm'):
+                    self.configuration.iscsi_helper in ('tgtadm', 'iseradm')):
                 properties['target_lun'] = 1
             else:
                 properties['target_lun'] = 0
index f13eebea1f479dc47e6e4184d07ef35d3fe1086d..e21ccbea1ca3e3774f5fdeff1a48792d3b79277e 100644 (file)
@@ -269,4 +269,13 @@ class IetAdm(_ExportMixin, iscsi.IetAdm):
 
 
 class ISERTgtAdm(_ExportMixin, iscsi.ISERTgtAdm):
-    pass
+    def _get_target_and_lun(self, context, volume, max_targets):
+        lun = 1  # For tgtadm the controller is lun 0, dev starts at lun 1
+        iscsi_target = 0  # NOTE(jdg): Not used by tgtadm
+        return iscsi_target, lun
+
+    def _get_iscsi_target(self, context, vol_id):
+        return 0
+
+    def _get_target_for_ensure_export(self, context, volume_id):
+        return 1