VMAX Target iSCSI IP Address

In VMAX iSCSI driver, the iscsi_ip_address was hardcoded
in cinder.conf. This may have issues with multi-portgroup
environment. If a customer has multiple portgroups
containing different ports with different iSCSI IP addresses,
then ‘iscsiadm‘ command cannot use more than the one hardcoded
IP address in its sendtargets operation.

This patch addresses this by examining the ports in the
portgroup of the masking view used in the attach operation.
Each port has a corresponding iSCSI IP address. A portgroup
with only one port will have one IP address; a portgroup with
multiple ports will have multiple IP addresses. Even if there
is more than one IP address, the first in the list is likely to
result in a successful iscsiadm -sendtargets.

Closes-Bug: #1501678
Change-Id: I52ab6b278a114d55aec5e66b38ff76fd1bfb1b49
This commit is contained in:
Xing Yang
2015-09-30 22:28:56 -04:00
parent a992336d07
commit 3793ed0491
5 changed files with 196 additions and 37 deletions

View File

@@ -2376,3 +2376,55 @@ class EMCVMAXUtils(object):
'last': poolName[-7:]}))
else:
return poolName
def get_iscsi_protocol_endpoints(self, conn, portgroupinstancename):
"""Get the iscsi protocol endpoints of a port group.
:param conn: the ecom connection
:param portgroupinstancename: the portgroup instance name
:returns: iscsiendpoints
"""
iscsiendpoints = conn.AssociatorNames(
portgroupinstancename,
AssocClass='CIM_MemberOfCollection')
return iscsiendpoints
def get_tcp_protocol_endpoints(self, conn, iscsiendpointinstancename):
"""Get the tcp protocol endpoints associated with an iscsi endpoint
:param conn: the ecom connection
:param iscsiendpointinstancename: the iscsi endpoint instance name
:returns: tcpendpoints
"""
tcpendpoints = conn.AssociatorNames(
iscsiendpointinstancename,
AssocClass='CIM_BindsTo')
return tcpendpoints
def get_ip_protocol_endpoints(self, conn, tcpendpointinstancename):
"""Get the ip protocol endpoints associated with an tcp endpoint
:param conn: the ecom connection
:param tcpendpointinstancename: the tcp endpoint instance name
:returns: ipendpoints
"""
ipendpoints = conn.AssociatorNames(
tcpendpointinstancename,
AssocClass='CIM_BindsTo')
return ipendpoints
def get_iscsi_ip_address(self, conn, ipendpointinstancename):
"""Get the IPv4Address from the ip endpoint instance name
:param conn: the ecom connection
:param ipendpointinstancename: the ip endpoint instance name
:returns: foundIpAddress
"""
foundIpAddress = None
ipendpointinstance = conn.GetInstance(ipendpointinstancename)
propertiesList = ipendpointinstance.properties.items()
for properties in propertiesList:
if properties[0] == 'IPv4Address':
cimProperties = properties[1]
foundIpAddress = cimProperties.value
return foundIpAddress