Add iSCSI IPv6 support to Dell EMC XtremIO driver
iSCSI IPv6 portal format is [IPv6Address]:Port. XtremIO driver returns iSCSI IPv6 portals without brackets. Therefore volume attach operation fails. This patch encloses iSCSI IPv6 portals in square brackets. Closes-Bug: #1918889 Change-Id: I4b4f1f61a6fa7e022d97015e0402dd7e5c24bf38
This commit is contained in:
parent
a6c71f5439
commit
b9bc307793
@ -18,6 +18,7 @@ import re
|
|||||||
import time
|
import time
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
|
from oslo_utils import netutils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from cinder import context
|
from cinder import context
|
||||||
@ -700,6 +701,24 @@ class XtremIODriverISCSITestCase(BaseXtremIODriverTestCase):
|
|||||||
self.driver.initialize_connection(self.data.test_volume2,
|
self.driver.initialize_connection(self.data.test_volume2,
|
||||||
self.data.connector)
|
self.data.connector)
|
||||||
|
|
||||||
|
def test_initialize_connection_escape_ipv6(self, req):
|
||||||
|
req.side_effect = xms_request
|
||||||
|
portals = xms_data['iscsi-portals'].copy()
|
||||||
|
xms_data['iscsi-portals'] = {
|
||||||
|
'fd00:206:553::7/16': {
|
||||||
|
"port-address": "iqn.2008-05.com.xtremio:003e67939c34",
|
||||||
|
"ip-port": 3260,
|
||||||
|
"ip-addr": "fd00:206:553::7/16",
|
||||||
|
"name": "fd00:206:553::7/16",
|
||||||
|
"index": 1,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
lunmap = {'lun': 4}
|
||||||
|
connection_properties = self.driver._get_iscsi_properties(lunmap)
|
||||||
|
result_addr, _ = connection_properties['target_portal'].rsplit(':', 1)
|
||||||
|
self.assertEqual(netutils.escape_ipv6('fd00:206:553::7'), result_addr)
|
||||||
|
xms_data['iscsi-portals'] = portals
|
||||||
|
|
||||||
def test_terminate_connection(self, req):
|
def test_terminate_connection(self, req):
|
||||||
req.side_effect = xms_request
|
req.side_effect = xms_request
|
||||||
self.driver.create_volume(self.data.test_volume)
|
self.driver.create_volume(self.data.test_volume)
|
||||||
|
@ -32,6 +32,7 @@ Supports XtremIO version 2.4 and up.
|
|||||||
1.0.10 - option to clean unused IGs
|
1.0.10 - option to clean unused IGs
|
||||||
1.0.11 - add support for multiattach
|
1.0.11 - add support for multiattach
|
||||||
1.0.12 - add support for ports filtering
|
1.0.12 - add support for ports filtering
|
||||||
|
1.0.13 - add support for iSCSI IPv6
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
@ -41,6 +42,7 @@ import string
|
|||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
from oslo_utils import netutils
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
from oslo_utils import units
|
from oslo_utils import units
|
||||||
import requests
|
import requests
|
||||||
@ -427,7 +429,7 @@ class XtremIOClient42(XtremIOClient4):
|
|||||||
class XtremIOVolumeDriver(san.SanDriver):
|
class XtremIOVolumeDriver(san.SanDriver):
|
||||||
"""Executes commands relating to Volumes."""
|
"""Executes commands relating to Volumes."""
|
||||||
|
|
||||||
VERSION = '1.0.12'
|
VERSION = '1.0.13'
|
||||||
|
|
||||||
# ThirdPartySystems wiki
|
# ThirdPartySystems wiki
|
||||||
CI_WIKI_NAME = "DellEMC_XtremIO_CI"
|
CI_WIKI_NAME = "DellEMC_XtremIO_CI"
|
||||||
@ -1207,11 +1209,12 @@ class XtremIOISCSIDriver(XtremIOVolumeDriver, driver.ISCSIDriver):
|
|||||||
raise exception.VolumeBackendAPIException(data=msg)
|
raise exception.VolumeBackendAPIException(data=msg)
|
||||||
portal = RANDOM.choice(allowed_portals)
|
portal = RANDOM.choice(allowed_portals)
|
||||||
portal_addr = ('%(ip)s:%(port)d' %
|
portal_addr = ('%(ip)s:%(port)d' %
|
||||||
{'ip': portal['ip-addr'],
|
{'ip': netutils.escape_ipv6(portal['ip-addr']),
|
||||||
'port': portal['ip-port']})
|
'port': portal['ip-port']})
|
||||||
|
|
||||||
tg_portals = ['%(ip)s:%(port)d' % {'ip': p['ip-addr'],
|
tg_portals = ['%(ip)s:%(port)d' %
|
||||||
'port': p['ip-port']}
|
{'ip': netutils.escape_ipv6(p['ip-addr']),
|
||||||
|
'port': p['ip-port']}
|
||||||
for p in allowed_portals]
|
for p in allowed_portals]
|
||||||
properties = {'target_discovered': False,
|
properties = {'target_discovered': False,
|
||||||
'target_iqn': portal['port-address'],
|
'target_iqn': portal['port-address'],
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
`Bug #1918889 <https://bugs.launchpad.net/cinder/+bug/1918889>`_:
|
||||||
|
Add support for iSCSI IPv6 in XtremIO driver.
|
Loading…
Reference in New Issue
Block a user