Pure: Report SAM-2 addressing mode for LUNs

Pure iSCSI and FC drivers use SCSI SAM-2 addressing mode, which means
that LUNs < 256 use peripheral mode (unmodified values) and LUNs >= 256
use flat mode (2 higher bits of the MSB must be 01b).

This is not the standard behavior of os-brick, which defaults to
SAM/transparent mode.

In this patch the Pure storage driver reports it's addressing mode so
that LUNs with value greater than 255 can be connected by os-brick.

Depends-On: If32d054e8f944f162bdc8700d842134a80049877
Closes-Bug: #2006960
Change-Id: I4abfb6de58340c5ea70e7a796326f5d2089c80eb
This commit is contained in:
Gorka Eguileor 2023-02-21 20:17:32 +01:00 committed by Simon Dodsley
parent 4da12c70ac
commit dad485ea66
4 changed files with 21 additions and 1 deletions

View File

@ -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 = {

View File

@ -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,
}
}

View File

@ -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)

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Pure iSCSI & FC driver `bug #2006960
<https://bugs.launchpad.net/cinder/+bug/2006960>`_: Fixed attaching LUNs
greater than 255. Driver leverages new os-brick functionality to specify
LUN addressing mode.