diff --git a/cinder/tests/unit/volume/drivers/test_pure.py b/cinder/tests/unit/volume/drivers/test_pure.py index de59abc13e0..45279b84836 100644 --- a/cinder/tests/unit/volume/drivers/test_pure.py +++ b/cinder/tests/unit/volume/drivers/test_pure.py @@ -248,6 +248,7 @@ ISCSI_CONNECTION_INFO = { ISCSI_IPS[2] + ":" + TARGET_PORT, ISCSI_IPS[3] + ":" + TARGET_PORT], "wwn": "3624a93709714b5cb91634c470002b2c8", + "addressing_mode": "SAM2", }, } ISCSI_CONNECTION_INFO_V6 = { @@ -262,6 +263,7 @@ ISCSI_CONNECTION_INFO_V6 = { ISCSI_IPS[6] + ":" + TARGET_PORT, ISCSI_IPS[7] + ":" + TARGET_PORT], "wwn": "3624a93709714b5cb91634c470002b2c8", + "addressing_mode": "SAM2", }, } ISCSI_CONNECTION_INFO_AC = { @@ -283,6 +285,7 @@ ISCSI_CONNECTION_INFO_AC = { AC_ISCSI_IPS[2] + ":" + TARGET_PORT, AC_ISCSI_IPS[3] + ":" + TARGET_PORT], "wwn": "3624a93709714b5cb91634c470002b2c8", + "addressing_mode": "SAM2", }, } ISCSI_CONNECTION_INFO_AC_FILTERED = { @@ -305,6 +308,7 @@ ISCSI_CONNECTION_INFO_AC_FILTERED = { AC_ISCSI_IPS[1] + ":" + TARGET_PORT, AC_ISCSI_IPS[2] + ":" + TARGET_PORT], "wwn": "3624a93709714b5cb91634c470002b2c8", + "addressing_mode": "SAM2", }, } ISCSI_CONNECTION_INFO_AC_FILTERED_LIST = { @@ -322,6 +326,7 @@ ISCSI_CONNECTION_INFO_AC_FILTERED_LIST = { AC_ISCSI_IPS[5] + ":" + TARGET_PORT, # IPv6 AC_ISCSI_IPS[6] + ":" + TARGET_PORT], # IPv6 "wwn": "3624a93709714b5cb91634c470002b2c8", + "addressing_mode": "SAM2", }, } @@ -409,6 +414,7 @@ FC_CONNECTION_INFO = { "initiator_target_map": INITIATOR_TARGET_MAP, "discard": True, "wwn": "3624a93709714b5cb91634c470002b2c8", + "addressing_mode": "SAM2", }, } FC_CONNECTION_INFO_AC = { @@ -422,6 +428,7 @@ FC_CONNECTION_INFO_AC = { "initiator_target_map": AC_INITIATOR_TARGET_MAP, "discard": True, "wwn": "3624a93709714b5cb91634c470002b2c8", + "addressing_mode": "SAM2", }, } PURE_SNAPSHOT = { diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index f623a39a0e0..3d3fa391a33 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -2775,7 +2775,8 @@ class ISCSIDriver(VolumeDriver): If the backend driver supports multiple connections for multipath and for single path with failover, "target_portals", "target_iqns", - "target_luns" are also populated:: + "target_luns" are also populated. In this example also LUN values + greater than 255 use flat addressing mode:: { 'driver_volume_type': 'iscsi', @@ -2790,6 +2791,7 @@ class ISCSIDriver(VolumeDriver): 'target_luns': [1, 1], 'volume_id': 1, 'discard': False, + 'addressing_mode': os_brick.constants.SCSI_ADDRESSING_SAM2, } } """ @@ -2935,6 +2937,7 @@ class FibreChannelDriver(VolumeDriver): 'target_lun': 1, 'target_wwn': ['1234567890123', '0987654321321'], 'discard': False, + 'addressing_mode': os_brick.constants.SCSI_ADDRESSING_SAM2, } } diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index 3b0acfa9da6..d45af05435f 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -24,6 +24,7 @@ import platform import re import uuid +from os_brick import constants as brick_constants from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils @@ -2856,6 +2857,7 @@ class PureISCSIDriver(PureBaseVolumeDriver, san.SanISCSIDriver): "data": { "target_discovered": False, "discard": True, + "addressing_mode": brick_constants.SCSI_ADDRESSING_SAM2, }, } @@ -3096,6 +3098,7 @@ class PureFCDriver(PureBaseVolumeDriver, driver.FibreChannelDriver): "target_wwns": target_wwns, "initiator_target_map": init_targ_map, "discard": True, + "addressing_mode": brick_constants.SCSI_ADDRESSING_SAM2, } } properties["data"]["wwn"] = self._get_wwn(pure_vol_name) diff --git a/releasenotes/notes/pure-report-addressing-91963e29fbed32a4.yaml b/releasenotes/notes/pure-report-addressing-91963e29fbed32a4.yaml new file mode 100644 index 00000000000..1080695760c --- /dev/null +++ b/releasenotes/notes/pure-report-addressing-91963e29fbed32a4.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Pure iSCSI & FC driver `bug #2006960 + `_: Fixed attaching LUNs + greater than 255. Driver leverages new os-brick functionality to specify + LUN addressing mode.