From: nuritv Date: Mon, 28 Jul 2014 18:50:55 +0000 (+0300) Subject: fixing the iSER transport protocol when using LVMISERDriver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f66f9e5805070e5ad2ba4688c6c4571ef1ec395a;p=openstack-build%2Fcinder-build.git fixing the iSER transport protocol when using LVMISERDriver 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 --- diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 086d430cf..20d290bc0 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -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 diff --git a/cinder/volume/iscsi.py b/cinder/volume/iscsi.py index f13eebea1..e21ccbea1 100644 --- a/cinder/volume/iscsi.py +++ b/cinder/volume/iscsi.py @@ -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