In cinder of the latest version, the function '_get_common_lun_map_id' has a error in 1242 line in cinder/volume/drivers/infortrend/raidcmd_cli/common_cli.py. This function is as follows.
==================================================================================
def _get_common_lun_map_id(self, wwpn_channel_info):
map_lun = None
# search for free lun id on all channels
for lun_id in range(self.constants['MAX_LUN_MAP_PER_CHL']):
lun_id_is_used = False
for slot_name in ['slot_a', 'slot_b']:
for wwpn in wwpn_channel_info:
channel_id = wwpn_channel_info[wwpn]['channel']
if channel_id not in self.map_dict[slot_name]:
continue
elif lun_id not in self.map_dict[slot_name][channel_id]:
lun_id_is_used = True
if not lun_id_is_used:
map_lun = lun_id
break
# check lun id overflow
elif (lun_id == self.constants['MAX_LUN_MAP_PER_CHL'] - 1):
msg = _('LUN map has reached maximum value [%(max_lun)s].') % {
'max_lun': self.constants['MAX_LUN_MAP_PER_CHL']}
LOG.error(msg)
raise exception.VolumeDriverException(message=msg)
return map_lun
==================================================================================
It should change "elif lun_id not in self.map_dict[slot_name][channel_id]:" into "elif lun_id in self.map_dict[slot_name][channel_id]:", or you will find that lun_id is always used although it is not used in fact.
Since this error exists, we cannot attach the infortrend type volume to a instance. And we will encounter the exception of the overflow of lun id. The log is as follows.
==================================================================================
2f3a7b0c7f1046fa9c89ef1cf32fdcca - default default] Driver initialize connection failed (error: Volume driver reported an error: LUN map has reached maximum value [8].).: VolumeDriverException: Volume driver reported an error: LUN map has reached maximum value [8].
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager Traceback (most recent call last):
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager File "/var/lib/openstack/local/lib/python2.7/site-packages/cinder/volume/manager.py", line 4366, in _connection_create
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager conn_info = self.driver.initialize_connection(volume, connector)
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager File "/var/lib/openstack/local/lib/python2.7/site-packages/cinder/volume/drivers/infortrend/infortrend_fc_cli.py", line 198, in initialize_connection
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager return self.common.initialize_connection(volume, connector)
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager File "/var/lib/openstack/local/lib/python2.7/site-packages/cinder/volume/drivers/infortrend/raidcmd_cli/common_cli.py", line 1690, in initialize_connection
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager return lock_initialize_conn()
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager File "/var/lib/openstack/local/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 274, in inner
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager return f(*args, **kwargs)
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager File "/var/lib/openstack/local/lib/python2.7/site-packages/cinder/volume/drivers/infortrend/raidcmd_cli/common_cli.py", line 1683, in lock_initialize_conn
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager volume, connector)
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager File "/var/lib/openstack/local/lib/python2.7/site-packages/cinder/volume/drivers/infortrend/raidcmd_cli/common_cli.py", line 1696, in _initialize_connection_fc
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager self._do_fc_connection(volume, connector)
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager File "/var/lib/openstack/local/lib/python2.7/site-packages/cinder/volume/drivers/infortrend/raidcmd_cli/common_cli.py", line 139, in inner
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager ret = func(self, *args, **kwargs)
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager File "/var/lib/openstack/local/lib/python2.7/site-packages/cinder/volume/drivers/infortrend/raidcmd_cli/common_cli.py", line 1753, in _do_fc_connection
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager map_lun = self._get_common_lun_map_id(wwpn_channel_info)
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager File "/var/lib/openstack/local/lib/python2.7/site-packages/cinder/volume/drivers/infortrend/raidcmd_cli/common_cli.py", line 1239, in _get_common_lun_map_id
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager for wwpn in wwpn_channel_info:
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager VolumeDriverException: Volume driver reported an error: LUN map has reached maximum value [8].
2020-03-21 09:39:21.496 113 ERROR cinder.volume.manager
2020-03-21 09:39:21.502 113 ERROR oslo_messaging.rpc.server [req-b07bd80c-2a50-476d-99dc-5d4ec24d4786 cb314eaab75343099d984b7e5d039560 2f3a7b0c7f1046fa9c89ef1cf32fdcca - default default] Exception during message handling: VolumeBackendAPIException: Bad or unexpected response from the storage volume backend API: Driver initialize connection failed (error: Volume driver reported an error: LUN map has reached maximum value [8].).
==================================================================================
Fix proposed to branch: master /review. opendev. org/713769
Review: https:/