* HP 3PAR are supporting multiple iSCSI node bind to same iSCSI
TCP/IP settings(CIM_iSCSIProtocolEndpoint).
Fixed by changing _iscsi_node_name_of() to _iscsi_node_names_of()
to allow multiple CIM_SCSIProtocolController(iSCSI node) of single
CIM_iSCSIProtocolEndpoint. No SNIA document deny or confirm it.
This also introduced the target_ports() support on Dell Compellent Storage
Center.
* HP 3PAR only support '1.2.0' version of 'iSCSI Target' profile.
Fixed by only need 1.1+ version. The download link of SNIA SMI-S 1.2
is broken. By checking SMI-S 1.1, all we required is included.
* EMC VMAX are supporting no iSCSI node bind to existing iSCSI
TCP/IP settings(CIM_iSCSIProtocolEndpoint).
Fixed by allowing empty association from CIM_iSCSIProtocolEndpoint
to CIM_SCSIProtocolController.
* NetApp-E indicates support status of 1.0 'iSCSI Target' and 'FC Target'
profiles.
There is no 'iSCSI Target' or 'FC Target' profiles in SMI-S 1.0.
Override it in SmisCommon.__init__() at plugin_register() stage.
* Tested on all SMI-S providers I have via
lsmenv all lsmcli lt
* Tested on EMC VNX via 'lsmenv vnx plugin_test'.
Signed-off-by: Gris Ge <fge(a)redhat.com>
---
plugin/smispy/smis.py | 55 ++++++++++++++++++++++----------------------
plugin/smispy/smis_cap.py | 13 ++++-------
plugin/smispy/smis_common.py | 12 ++++++++++
3 files changed, 45 insertions(+), 35 deletions(-)
diff --git a/plugin/smispy/smis.py b/plugin/smispy/smis.py
index 6a165ea..4dc478c 100644
--- a/plugin/smispy/smis.py
+++ b/plugin/smispy/smis.py
@@ -1531,7 +1531,7 @@ def _cim_fc_tgt_to_lsm(cim_fc_tgt, system_id):
return TargetPort(port_id, port_type, wwpn, wwpn, wwpn, port_name,
system_id, plugin_data)
- def _iscsi_node_name_of(self, cim_iscsi_pg_path):
+ def _iscsi_node_names_of(self, cim_iscsi_pg_path):
"""
CIM_iSCSIProtocolEndpoint
|
@@ -1542,7 +1542,6 @@ def _iscsi_node_name_of(self, cim_iscsi_pg_path):
|
v
CIM_SCSIProtocolController # iSCSI Node
-
"""
cim_spcs = self._c.Associators(
cim_iscsi_pg_path,
@@ -1559,16 +1558,8 @@ def _iscsi_node_name_of(self, cim_iscsi_pg_path):
cim_iscsi_nodes.extend([cim_spc])
if len(cim_iscsi_nodes) == 0:
- raise LsmError(ErrorNumber.PLUGIN_BUG,
- "_iscsi_node_of(): No iSCSI node "
- "CIM_SCSIProtocolController associated to %s"
- % cim_iscsi_pg_path)
- if len(cim_iscsi_nodes) > 1:
- raise LsmError(ErrorNumber.PLUGIN_BUG,
- "_iscsi_node_of(): Got two or more iSCSI node "
- "CIM_SCSIProtocolController associated to %s: %s"
- % (cim_iscsi_pg_path, cim_iscsi_nodes))
- return cim_iscsi_nodes[0]['Name']
+ return []
+ return [n['Name'] for n in cim_iscsi_nodes]
def _cim_iscsi_pg_of(self, cim_sys_path, property_list=None):
"""
@@ -1633,7 +1624,10 @@ def _cim_iscsi_pg_to_lsm(self, cim_iscsi_pg, system_id):
"_cim_iscsi_pg_to_lsm(): "
"No CIM_TCPProtocolEndpoint associated to %s"
% cim_iscsi_pg.path)
- iscsi_node_name = self._iscsi_node_name_of(cim_iscsi_pg.path)
+ iscsi_node_names = self._iscsi_node_names_of(cim_iscsi_pg.path)
+
+ if len(iscsi_node_names) == 0:
+ return []
for cim_tcp in cim_tcps:
tcp_port = cim_tcp['PortNumber']
@@ -1704,13 +1698,17 @@ def _cim_iscsi_pg_to_lsm(self, cim_iscsi_pg, system_id):
if ipv4_addr:
network_address = "%s:%s" % (ipv4_addr, tcp_port)
- port_id = md5("%s:%s:%s" % (mac_address,
- network_address,
- iscsi_node_name))
+
rc.extend(
- [TargetPort(port_id, port_type, iscsi_node_name,
- network_address, mac_address,
- port_name, system_id, plugin_data)])
+ [TargetPort(
+ md5(
+ "%s:%s:%s" % (
+ mac_address, network_address,
+ iscsi_node_name)),
+ port_type, iscsi_node_name,
+ network_address, mac_address, port_name,
+ system_id, plugin_data)
+ for iscsi_node_name in iscsi_node_names])
if ipv6_addr:
# DMTF or SNIA did defined the IPv6 string format.
# we just guess here.
@@ -1721,13 +1719,16 @@ def _cim_iscsi_pg_to_lsm(self, cim_iscsi_pg, system_id):
ipv6_addr, 32, 4)
network_address = "[%s]:%s" % (ipv6_addr, tcp_port)
- port_id = md5("%s:%s:%s" % (mac_address,
- network_address,
- iscsi_node_name))
- rc.extend(
- [TargetPort(port_id, port_type, iscsi_node_name,
- network_address, mac_address,
- port_name, system_id, plugin_data)])
+ rc.extend([
+ TargetPort(
+ md5(
+ "%s:%s:%s" % (
+ mac_address, network_address,
+ iscsi_node_name)),
+ port_type, iscsi_node_name,
+ network_address, mac_address, port_name,
+ system_id, plugin_data)
+ for iscsi_node_name in iscsi_node_names])
return rc
def _leaf_cim_syss_path_of(self, cim_sys_path):
@@ -1783,7 +1784,7 @@ def target_ports(self, search_key=None, search_value=None,
flags=0):
"these profiles: '%s %s', '%s
%s'"
% (SmisCommon.SMIS_SPEC_VER_1_4,
SmisCommon.SNIA_FC_TGT_PORT_PROFILE,
- SmisCommon.SMIS_SPEC_VER_1_4,
+ SmisCommon.SMIS_SPEC_VER_1_1,
SmisCommon.SNIA_ISCSI_TGT_PORT_PROFILE))
if flag_fc_support:
diff --git a/plugin/smispy/smis_cap.py b/plugin/smispy/smis_cap.py
index 23a3449..f42ce94 100644
--- a/plugin/smispy/smis_cap.py
+++ b/plugin/smispy/smis_cap.py
@@ -248,10 +248,7 @@ def _tgt_cap_set(smis_common, cim_sys_path, cap):
return
flag_fc_support = fc_tgt_is_supported(smis_common)
- flag_iscsi_support = smis_common.profile_check(
- SmisCommon.SNIA_ISCSI_TGT_PORT_PROFILE,
- SmisCommon.SMIS_SPEC_VER_1_4,
- raise_error=False)
+ flag_iscsi_support = iscsi_tgt_is_supported(smis_common)
if flag_fc_support or flag_iscsi_support:
cap.set(Capabilities.TARGET_PORTS)
@@ -311,12 +308,12 @@ def fc_tgt_is_supported(smis_common):
def iscsi_tgt_is_supported(smis_common):
"""
- Return True if FC Target Port 1.4+ profile is supported.
+ Return True if FC Target Port 1.1+ profile is supported.
We use CIM_iSCSIProtocolEndpoint as it's a start point we are
using in our code of target_ports().
"""
if smis_common.profile_check(SmisCommon.SNIA_ISCSI_TGT_PORT_PROFILE,
- SmisCommon.SMIS_SPEC_VER_1_4,
+ SmisCommon.SMIS_SPEC_VER_1_1,
raise_error=False):
return True
return False
@@ -324,12 +321,12 @@ def iscsi_tgt_is_supported(smis_common):
def multi_sys_is_supported(smis_common):
"""
- Return True if Multiple ComputerSystem 1.4+ profile is supported.
+ Return True if Multiple ComputerSystem 1.1+ profile is supported.
Return False else.
"""
flag_multi_sys_support = smis_common.profile_check(
SmisCommon.SNIA_MULTI_SYS_PROFILE,
- SmisCommon.SMIS_SPEC_VER_1_4,
+ SmisCommon.SMIS_SPEC_VER_1_1,
raise_error=False)
if flag_multi_sys_support:
return True
diff --git a/plugin/smispy/smis_common.py b/plugin/smispy/smis_common.py
index 7b6924f..f4bd024 100644
--- a/plugin/smispy/smis_common.py
+++ b/plugin/smispy/smis_common.py
@@ -168,6 +168,7 @@ class SmisCommon(object):
SNIA_FC_TGT_PORT_PROFILE = 'FC Target Ports'
SNIA_ISCSI_TGT_PORT_PROFILE = 'iSCSI Target Ports'
SNIA_SPARE_DISK_PROFILE = 'Disk Sparing'
+ SMIS_SPEC_VER_1_1 = '1.1'
SMIS_SPEC_VER_1_4 = '1.4'
SMIS_SPEC_VER_1_5 = '1.5'
SMIS_SPEC_VER_1_6 = '1.6'
@@ -232,6 +233,17 @@ def __init__(self, url, username, password,
if namespace.lower() == SmisCommon._NETAPP_E_NAMESPACE.lower():
self._vendor_product = SmisCommon._PRODUCT_NETAPP_E
+ # NetApp-E indicates they support 1.0 version of FC/iSCSI target
+ # But 1.0 does not define thoese profiles. Forcly change
+ # support version to 1.4
+ self._profile_dict[SmisCommon.SNIA_FC_TGT_PORT_PROFILE] = \
+ SmisCommon.SMIS_SPEC_VER_1_4
+ self._profile_dict[SmisCommon.SNIA_ISCSI_TGT_PORT_PROFILE] = \
+ SmisCommon.SMIS_SPEC_VER_1_4
+ # NetApp-E indicates support of Mask and Mapping 1.2. But
+ # SNIA website link for 1.2 broken. Change it to 1.4.
+ self._profile_dict[SmisCommon.SNIA_MASK_PROFILE] = \
+ SmisCommon.SMIS_SPEC_VER_1_4
# Check 'Array' 1.4 support status.
_profile_check(
--
1.8.3.1