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
This commit is contained in:
nuritv
2014-07-28 21:50:55 +03:00
parent 0ca525fe29
commit f66f9e5805
2 changed files with 13 additions and 3 deletions

View 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

View 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