Add support for Infortrend GS Series products

Channel types change to LAN & Fibre in GS Series, add support for it.
Change the folder name.

Add FC should return empty data instead of None in terminate connection call.
Check mapping before iSCSI delete the host iqn to avoid retry.

Change-Id: I1d937d19ffbb9dd120115a3f3eb27aade878e446
This commit is contained in:
Johnny Chou 2016-09-27 20:32:09 +08:00
parent 1a120c9887
commit 6850c8bae2
8 changed files with 42 additions and 28 deletions

View File

@ -132,8 +132,8 @@ from cinder.volume.drivers.ibm.storwize_svc import storwize_svc_fc as \
cinder_volume_drivers_ibm_storwize_svc_storwizesvcfc
from cinder.volume.drivers.ibm.storwize_svc import storwize_svc_iscsi as \
cinder_volume_drivers_ibm_storwize_svc_storwizesvciscsi
from cinder.volume.drivers.infortrend.eonstor_ds_cli import common_cli as \
cinder_volume_drivers_infortrend_eonstor_ds_cli_commoncli
from cinder.volume.drivers.infortrend.raidcmd_cli import common_cli as \
cinder_volume_drivers_infortrend_raidcmd_cli_commoncli
from cinder.volume.drivers.kaminario import kaminario_common as \
cinder_volume_drivers_kaminario_kaminariocommon
from cinder.volume.drivers.lenovo import lenovo_common as \
@ -203,6 +203,10 @@ def list_opts():
cinder_backup_driver.service_opts,
[cinder_cmd_volume.cluster_opt],
cinder_volume_drivers_hitachi_hnasutils.drivers_common_opts,
cinder_volume_drivers_infortrend_raidcmd_cli_commoncli.
infortrend_esds_opts,
cinder_volume_drivers_infortrend_raidcmd_cli_commoncli.
infortrend_esds_extra_opts,
cinder_api_common.api_common_opts,
cinder_backup_drivers_ceph.service_opts,
cinder_volume_drivers_smbfs.volume_opts,
@ -303,10 +307,6 @@ def list_opts():
cinder_backup_drivers_google.gcsbackup_service_opts,
[cinder_api_middleware_auth.use_forwarded_for_opt],
cinder_volume_drivers_hitachi_hbsdcommon.volume_opts,
cinder_volume_drivers_infortrend_eonstor_ds_cli_commoncli.
infortrend_esds_opts,
cinder_volume_drivers_infortrend_eonstor_ds_cli_commoncli.
infortrend_esds_extra_opts,
cinder_volume_drivers_hitachi_hnasiscsi.iSCSI_OPTS,
cinder_volume_drivers_rbd.RBD_OPTS,
cinder_volume_drivers_tintri.tintri_opts,

View File

@ -16,7 +16,7 @@
import mock
from cinder import test
from cinder.volume.drivers.infortrend.eonstor_ds_cli import cli_factory as cli
from cinder.volume.drivers.infortrend.raidcmd_cli import cli_factory as cli
class InfortrendCLITestData(object):

View File

@ -22,7 +22,7 @@ from cinder import test
from cinder.tests.unit import utils
from cinder.tests.unit.volume.drivers.infortrend import test_infortrend_cli
from cinder.volume import configuration
from cinder.volume.drivers.infortrend.eonstor_ds_cli import common_cli
from cinder.volume.drivers.infortrend.raidcmd_cli import common_cli
SUCCEED = (0, '')
FAKE_ERROR_RETURN = (-1, '')
@ -416,6 +416,7 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
mock_commands = {
'DeleteMap': SUCCEED,
'ShowMap': self.cli_data.get_test_show_map(),
'ShowWWN': SUCCEED,
}
self._driver_setup(mock_commands)
@ -424,6 +425,7 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
expect_cli_cmd = [
mock.call('DeleteMap', 'part', test_partition_id, '-y'),
mock.call('ShowMap'),
mock.call('ShowWWN'),
]
self._assert_cli_has_calls(expect_cli_cmd)
@ -496,9 +498,11 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
mock.call('DeleteMap', 'part', test_partition_id, '-y'),
mock.call('ShowMap'),
]
expect_conn_info = {'driver_volume_type': 'fibre_channel',
'data': {}}
self._assert_cli_has_calls(expect_cli_cmd)
self.assertIsNone(conn_info)
self.assertEqual(expect_conn_info, conn_info)
class InfortrendiSCSICommonTestCase(InfortrendTestCass):
@ -1505,8 +1509,8 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
mock_commands = {
'DeleteMap': SUCCEED,
'DeleteIQN': SUCCEED,
'ShowMap': self.cli_data.get_test_show_map(),
'DeleteIQN': SUCCEED,
}
self._driver_setup(mock_commands)
@ -1514,8 +1518,8 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
expect_cli_cmd = [
mock.call('DeleteMap', 'part', test_partition_id, '-y'),
mock.call('DeleteIQN', test_connector['initiator'][-16:]),
mock.call('ShowMap'),
mock.call('DeleteIQN', test_connector['initiator'][-16:]),
]
self._assert_cli_has_calls(expect_cli_cmd)

View File

@ -21,7 +21,7 @@ from oslo_log import log as logging
from cinder import interface
from cinder.volume import driver
from cinder.volume.drivers.infortrend.eonstor_ds_cli import common_cli
from cinder.volume.drivers.infortrend.raidcmd_cli import common_cli
from cinder.zonemanager import utils as fczm_utils
LOG = logging.getLogger(__name__)
@ -35,6 +35,7 @@ class InfortrendCLIFCDriver(driver.FibreChannelDriver):
Version history:
1.0.0 - Initial driver
1.0.1 - Support DS4000
1.0.2 - Support GS Series
"""
# ThirdPartySystems wiki page

View File

@ -20,7 +20,7 @@ from oslo_log import log as logging
from cinder import interface
from cinder.volume import driver
from cinder.volume.drivers.infortrend.eonstor_ds_cli import common_cli
from cinder.volume.drivers.infortrend.raidcmd_cli import common_cli
LOG = logging.getLogger(__name__)
@ -33,6 +33,7 @@ class InfortrendCLIISCSIDriver(driver.ISCSIDriver):
Version history:
1.0.0 - Initial driver
1.0.1 - Support DS4000
1.0.2 - Support GS Series
"""
# ThirdPartySystems wiki page

View File

@ -27,7 +27,7 @@ from oslo_utils import units
from cinder import exception
from cinder.i18n import _, _LE, _LI, _LW
from cinder.volume.drivers.infortrend.eonstor_ds_cli import cli_factory as cli
from cinder.volume.drivers.infortrend.raidcmd_cli import cli_factory as cli
from cinder.volume.drivers.san import san
from cinder.volume import volume_types
from cinder.zonemanager import utils as fczm_utils
@ -156,9 +156,10 @@ class InfortrendCommon(object):
Version history:
1.0.0 - Initial driver
1.0.1 - Support DS4000
1.0.2 - Support GS Series
"""
VERSION = '1.0.1'
VERSION = '1.0.2'
constants = {
'ISCSI_PORT': 3260,
@ -329,10 +330,12 @@ class InfortrendCommon(object):
int(lun) in self.map_dict[slot_key][ch]):
self.map_dict[slot_key][ch].remove(int(lun))
def _check_initiator_has_lun_map(self, initiator_wwns, map_info):
for initiator in initiator_wwns:
def _check_initiator_has_lun_map(self, initiator_info, map_info):
if not isinstance(initiator_info, list):
initiator_info = (initiator_info,)
for initiator_name in initiator_info:
for entry in map_info:
if initiator.lower() == entry['Host-ID'].lower():
if initiator_name.lower() == entry['Host-ID'].lower():
return True
return False
@ -341,12 +344,12 @@ class InfortrendCommon(object):
self, channel_info, controller='slot_a', multipath=False):
if self.protocol == 'iSCSI':
check_channel_type = 'NETWORK'
check_channel_type = ('NETWORK', 'LAN')
else:
check_channel_type = 'FIBRE'
check_channel_type = ('FIBRE', 'Fibre')
for entry in channel_info:
if entry['Type'] == check_channel_type:
if entry['Type'] in check_channel_type:
if entry['Ch'] in self.channel_list[controller]:
self.map_dict[controller][entry['Ch']] = []
@ -1584,19 +1587,24 @@ class InfortrendCommon(object):
part_id = self._get_part_id(volume_id)
self._execute('DeleteMap', 'part', part_id, '-y')
if self.protocol == 'iSCSI':
self._execute(
'DeleteIQN', self._truncate_host_name(connector['initiator']))
map_info = self._update_map_info(multipath)
if self.protocol == 'FC' and self.fc_lookup_service:
if self.protocol == 'iSCSI':
initiator_iqn = self._truncate_host_name(connector['initiator'])
lun_map_exist = self._check_initiator_has_lun_map(
initiator_iqn, map_info)
if not lun_map_exist:
self._execute('DeleteIQN', initiator_iqn)
elif self.protocol == 'FC':
conn_info = {'driver_volume_type': 'fibre_channel',
'data': {}}
lun_map_exist = self._check_initiator_has_lun_map(
connector['wwpns'], map_info)
if not lun_map_exist:
conn_info = {'driver_volume_type': 'fibre_channel',
'data': {}}
wwpn_list, wwpn_channel_info = self._get_wwpn_list()
init_target_map, target_wwpns = (
self._build_initiator_target_map(connector, wwpn_list)