Merge "rename ScaleIO connector to VxFlex OS"
This commit is contained in:
commit
04c6c0cc29
|
@ -64,3 +64,4 @@ VERITAS_HYPERSCALE = "VERITAS_HYPERSCALE"
|
|||
STORPOOL = "STORPOOL"
|
||||
NVME = "NVME"
|
||||
NVMEOF = "NVMEOF"
|
||||
VXFLEXOS = "VXFLEXOS"
|
||||
|
|
|
@ -55,7 +55,6 @@ connector_list = [
|
|||
'os_brick.initiator.connectors.drbd.DRBDConnector',
|
||||
'os_brick.initiator.connectors.huawei.HuaweiStorHyperConnector',
|
||||
'os_brick.initiator.connectors.hgst.HGSTConnector',
|
||||
'os_brick.initiator.connectors.scaleio.ScaleIOConnector',
|
||||
'os_brick.initiator.connectors.disco.DISCOConnector',
|
||||
'os_brick.initiator.connectors.vmware.VmdkConnector',
|
||||
'os_brick.initiator.windows.base.BaseWindowsConnector',
|
||||
|
@ -65,8 +64,16 @@ connector_list = [
|
|||
'os_brick.initiator.connectors.vrtshyperscale.HyperScaleConnector',
|
||||
'os_brick.initiator.connectors.storpool.StorPoolConnector',
|
||||
'os_brick.initiator.connectors.nvme.NVMeConnector',
|
||||
'os_brick.initiator.connectors.vxflexos.VxFlexOsConnector'
|
||||
]
|
||||
|
||||
|
||||
# protocol_mapping is used for protocol renames
|
||||
# place old protocol name in dict key and new protocol name in value
|
||||
protocol_mapping = {
|
||||
initiator.SCALEIO: initiator.VXFLEXOS
|
||||
}
|
||||
|
||||
# Mappings used to determine who to construct in the factory
|
||||
_connector_mapping_linux = {
|
||||
initiator.AOE:
|
||||
|
@ -100,8 +107,6 @@ _connector_mapping_linux = {
|
|||
'os_brick.initiator.connectors.hgst.HGSTConnector',
|
||||
initiator.RBD:
|
||||
'os_brick.initiator.connectors.rbd.RBDConnector',
|
||||
initiator.SCALEIO:
|
||||
'os_brick.initiator.connectors.scaleio.ScaleIOConnector',
|
||||
initiator.DISCO:
|
||||
'os_brick.initiator.connectors.disco.DISCOConnector',
|
||||
initiator.SHEEPDOG:
|
||||
|
@ -118,6 +123,8 @@ _connector_mapping_linux = {
|
|||
'os_brick.initiator.connectors.nvme.NVMeConnector',
|
||||
initiator.NVMEOF:
|
||||
'os_brick.initiator.connectors.nvme.NVMeConnector',
|
||||
initiator.VXFLEXOS:
|
||||
'os_brick.initiator.connectors.vxflexos.VxFlexOsConnector',
|
||||
}
|
||||
|
||||
# Mapping for the S390X platform
|
||||
|
@ -277,6 +284,15 @@ class InitiatorConnector(object):
|
|||
{'protocol': protocol, 'arch': arch})
|
||||
protocol = protocol.upper()
|
||||
|
||||
if protocol in protocol_mapping:
|
||||
_protocol = protocol
|
||||
protocol = protocol_mapping[_protocol]
|
||||
LOG.warning("Protocol %(old_name)s is deprecated and "
|
||||
"will be removed in future release, "
|
||||
"use %(new_name)s protocol instead",
|
||||
{'old_name': _protocol,
|
||||
'new_name': protocol})
|
||||
|
||||
# set any special kwargs needed by connectors
|
||||
if protocol in (initiator.NFS, initiator.GLUSTERFS,
|
||||
initiator.SCALITY, initiator.QUOBYTE,
|
||||
|
|
|
@ -33,8 +33,8 @@ DEVICE_SCAN_ATTEMPTS_DEFAULT = 3
|
|||
synchronized = lockutils.synchronized_with_prefix('os-brick-')
|
||||
|
||||
|
||||
class ScaleIOConnector(base.BaseLinuxConnector):
|
||||
"""Class implements the connector driver for ScaleIO."""
|
||||
class VxFlexOsConnector(base.BaseLinuxConnector):
|
||||
"""Class implements the connector driver for VxFlex OS."""
|
||||
|
||||
OK_STATUS_CODE = 200
|
||||
VOLUME_NOT_MAPPED_ERROR = 84
|
||||
|
@ -45,7 +45,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
def __init__(self, root_helper, driver=None,
|
||||
device_scan_attempts=initiator.DEVICE_SCAN_ATTEMPTS_DEFAULT,
|
||||
*args, **kwargs):
|
||||
super(ScaleIOConnector, self).__init__(
|
||||
super(VxFlexOsConnector, self).__init__(
|
||||
root_helper,
|
||||
driver=driver,
|
||||
device_scan_attempts=device_scan_attempts,
|
||||
|
@ -66,7 +66,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
|
||||
@staticmethod
|
||||
def get_connector_properties(root_helper, *args, **kwargs):
|
||||
"""The ScaleIO connector properties."""
|
||||
"""The VxFlex OS connector properties."""
|
||||
return {}
|
||||
|
||||
def get_search_path(self):
|
||||
|
@ -106,7 +106,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
def _wait_for_volume_path(self, path):
|
||||
if not os.path.isdir(path):
|
||||
msg = (
|
||||
_("ScaleIO volume %(volume_id)s not found at "
|
||||
_("VxFlex OS volume %(volume_id)s not found at "
|
||||
"expected path.") % {'volume_id': self.volume_id}
|
||||
)
|
||||
|
||||
|
@ -127,7 +127,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
break
|
||||
|
||||
if not disk_filename:
|
||||
msg = (_("ScaleIO volume %(volume_id)s not found.") %
|
||||
msg = (_("VxFlex OS volume %(volume_id)s not found.") %
|
||||
{'volume_id': self.volume_id})
|
||||
LOG.debug(msg)
|
||||
raise exception.BrickException(message=msg)
|
||||
|
@ -145,7 +145,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
}
|
||||
)
|
||||
|
||||
LOG.info("ScaleIO get client id by ip request: %(request)s",
|
||||
LOG.info("VxFlex OS get client id by ip request: %(request)s",
|
||||
{'request': request})
|
||||
|
||||
r = requests.get(
|
||||
|
@ -168,7 +168,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
LOG.error(msg)
|
||||
raise exception.BrickException(message=msg)
|
||||
|
||||
LOG.info("ScaleIO sdc id is %(sdc_id)s.",
|
||||
LOG.info("VxFlex os sdc id is %(sdc_id)s.",
|
||||
{'sdc_id': sdc_id})
|
||||
return sdc_id
|
||||
|
||||
|
@ -191,7 +191,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
)
|
||||
|
||||
LOG.info(
|
||||
"ScaleIO get volume id by name request: %(request)s",
|
||||
"VxFlex OS get volume id by name request: %(request)s",
|
||||
{'request': request}
|
||||
)
|
||||
|
||||
|
@ -219,7 +219,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
LOG.error(msg)
|
||||
raise exception.BrickException(message=msg)
|
||||
|
||||
LOG.info("ScaleIO volume id is %(volume_id)s.",
|
||||
LOG.info("VxFlex OS volume id is %(volume_id)s.",
|
||||
{'volume_id': volume_id})
|
||||
return volume_id
|
||||
|
||||
|
@ -266,8 +266,24 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
|
||||
def get_config(self, connection_properties):
|
||||
self.local_sdc_ip = connection_properties['hostIP']
|
||||
# handle deprecated parameters for backward compatibility
|
||||
d_option_used = False
|
||||
try:
|
||||
self.volume_name = connection_properties['vxflexos_volname']
|
||||
except KeyError:
|
||||
self.volume_name = connection_properties['scaleIO_volname']
|
||||
d_option_used = True
|
||||
try:
|
||||
self.volume_id = connection_properties['vxflexos_volume_id']
|
||||
except KeyError:
|
||||
self.volume_id = connection_properties['scaleIO_volume_id']
|
||||
d_option_used = True
|
||||
if d_option_used:
|
||||
LOG.warning("Deprecated: scaleIO_volname and scaleIO_volume_id "
|
||||
"connector parameters are deprecated and will be "
|
||||
"removed in future release, use "
|
||||
"vxflexos_volname and vxflexos_volume_id parameters "
|
||||
"instead.")
|
||||
self.server_ip = connection_properties['serverIP']
|
||||
self.server_port = connection_properties['serverPort']
|
||||
self.server_username = connection_properties['serverUsername']
|
||||
|
@ -280,7 +296,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
return device_info
|
||||
|
||||
@utils.trace
|
||||
@lockutils.synchronized('scaleio', 'scaleio-')
|
||||
@lockutils.synchronized('vxflexos', 'vxflexos-')
|
||||
def connect_volume(self, connection_properties):
|
||||
"""Connect the volume.
|
||||
|
||||
|
@ -292,7 +308,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
device_info = self.get_config(connection_properties)
|
||||
LOG.debug(
|
||||
_(
|
||||
"scaleIO Volume name: %(volume_name)s, SDC IP: %(sdc_ip)s, "
|
||||
"VxFlex OS Volume name: %(volume_name)s, SDC IP: %(sdc_ip)s, "
|
||||
"REST Server IP: %(server_ip)s, "
|
||||
"REST Server username: %(username)s, "
|
||||
"iops limit:%(iops_limit)s, "
|
||||
|
@ -308,7 +324,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
}
|
||||
)
|
||||
|
||||
LOG.info("ScaleIO sdc query guid command: %(cmd)s",
|
||||
LOG.info("VxFlex OS sdc query guid command: %(cmd)s",
|
||||
{'cmd': self.GET_GUID_CMD})
|
||||
|
||||
try:
|
||||
|
@ -411,10 +427,10 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
return device_info
|
||||
|
||||
@utils.trace
|
||||
@lockutils.synchronized('scaleio', 'scaleio-')
|
||||
@lockutils.synchronized('vxflexos', 'vxflexos-')
|
||||
def disconnect_volume(self, connection_properties, device_info,
|
||||
force=False, ignore_errors=False):
|
||||
"""Disconnect the ScaleIO volume.
|
||||
"""Disconnect the VxFlex OS volume.
|
||||
|
||||
:param connection_properties: The dictionary that describes all
|
||||
of the target volume attributes.
|
||||
|
@ -425,17 +441,17 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
self.get_config(connection_properties)
|
||||
self.volume_id = self.volume_id or self._get_volume_id()
|
||||
LOG.info(
|
||||
"ScaleIO disconnect volume in ScaleIO brick volume driver."
|
||||
"VxFlex OS disconnect volume in VxFlex OS brick volume driver."
|
||||
)
|
||||
|
||||
LOG.debug(
|
||||
_("ScaleIO Volume name: %(volume_name)s, SDC IP: %(sdc_ip)s, "
|
||||
_("VxFlex OS Volume name: %(volume_name)s, SDC IP: %(sdc_ip)s, "
|
||||
"REST Server IP: %(server_ip)s"),
|
||||
{'volume_name': self.volume_name, 'sdc_ip': self.local_sdc_ip,
|
||||
'server_ip': self.server_ip}
|
||||
)
|
||||
|
||||
LOG.info("ScaleIO sdc query guid command: %(cmd)s",
|
||||
LOG.info("VxFlex OS sdc query guid command: %(cmd)s",
|
||||
{'cmd': self.GET_GUID_CMD})
|
||||
|
||||
try:
|
||||
|
@ -493,10 +509,10 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
"""Update the local kernel's size information.
|
||||
|
||||
Try and update the local kernel's size information
|
||||
for a ScaleIO volume.
|
||||
for a VxFlex OS volume.
|
||||
"""
|
||||
|
||||
LOG.info("ScaleIO rescan volumes: %(cmd)s",
|
||||
LOG.info("VxFlex OS rescan volumes: %(cmd)s",
|
||||
{'cmd': self.RESCAN_VOLS_CMD})
|
||||
|
||||
try:
|
||||
|
@ -516,7 +532,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
|||
return self.get_device_size(volume_paths[0])
|
||||
|
||||
# if we got here, the volume is not mapped
|
||||
msg = (_("Error extending ScaleIO volume"))
|
||||
msg = (_("Error extending VxFlex OS volume"))
|
||||
LOG.error(msg)
|
||||
raise exception.BrickException(message=msg)
|
||||
|
|
@ -20,12 +20,12 @@ import six
|
|||
from oslo_concurrency import processutils as putils
|
||||
|
||||
from os_brick import exception
|
||||
from os_brick.initiator.connectors import scaleio
|
||||
from os_brick.initiator.connectors import vxflexos
|
||||
from os_brick.tests.initiator import test_connector
|
||||
|
||||
|
||||
class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
||||
"""Test cases for ScaleIO connector."""
|
||||
class VxFlexOsConnectorTestCase(test_connector.ConnectorTestCase):
|
||||
"""Test cases for VxFlex OS connector."""
|
||||
|
||||
# Fake volume information
|
||||
vol = {
|
||||
|
@ -38,13 +38,13 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
fake_guid = 'FAKE_GUID'
|
||||
|
||||
def setUp(self):
|
||||
super(ScaleIOConnectorTestCase, self).setUp()
|
||||
super(VxFlexOsConnectorTestCase, self).setUp()
|
||||
|
||||
self.fake_connection_properties = {
|
||||
'hostIP': test_connector.MY_IP,
|
||||
'serverIP': test_connector.MY_IP,
|
||||
'scaleIO_volname': self.vol['name'],
|
||||
'scaleIO_volume_id': self.vol['provider_id'],
|
||||
'vxflexos_volname': self.vol['name'],
|
||||
'vxflexos_volume_id': self.vol['provider_id'],
|
||||
'serverPort': 443,
|
||||
'serverUsername': 'test',
|
||||
'serverPassword': 'fake',
|
||||
|
@ -78,14 +78,14 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
), status_code=404)
|
||||
|
||||
# Patch the request and os calls to fake versions
|
||||
self.mock_object(requests, 'get', self.handle_scaleio_request)
|
||||
self.mock_object(requests, 'post', self.handle_scaleio_request)
|
||||
self.mock_object(requests, 'get', self.handle_vxflexos_request)
|
||||
self.mock_object(requests, 'post', self.handle_vxflexos_request)
|
||||
self.mock_object(os.path, 'isdir', return_value=True)
|
||||
self.mock_object(os, 'listdir',
|
||||
return_value=["emc-vol-{}".format(self.vol['id'])])
|
||||
|
||||
# The actual ScaleIO connector
|
||||
self.connector = scaleio.ScaleIOConnector(
|
||||
# The actual VxFlex OS connector
|
||||
self.connector = vxflexos.VxFlexOsConnector(
|
||||
'sudo', execute=self.fake_execute)
|
||||
|
||||
class MockHTTPSResponse(requests.Response):
|
||||
|
@ -94,7 +94,7 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
Defines the https replies from the mocked calls to do_request()
|
||||
"""
|
||||
def __init__(self, content, status_code=200):
|
||||
super(ScaleIOConnectorTestCase.MockHTTPSResponse,
|
||||
super(VxFlexOsConnectorTestCase.MockHTTPSResponse,
|
||||
self).__init__()
|
||||
|
||||
self._content = content
|
||||
|
@ -103,7 +103,7 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
|
||||
def json(self, **kwargs):
|
||||
if isinstance(self._content, six.string_types):
|
||||
return super(ScaleIOConnectorTestCase.MockHTTPSResponse,
|
||||
return super(VxFlexOsConnectorTestCase.MockHTTPSResponse,
|
||||
self).json(**kwargs)
|
||||
|
||||
return self._content
|
||||
|
@ -114,7 +114,7 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
return json.dumps(self._content)
|
||||
|
||||
self._content = self._content.encode('utf-8')
|
||||
return super(ScaleIOConnectorTestCase.MockHTTPSResponse,
|
||||
return super(VxFlexOsConnectorTestCase.MockHTTPSResponse,
|
||||
self).text
|
||||
|
||||
def fake_execute(self, *cmd, **kwargs):
|
||||
|
@ -125,7 +125,7 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
"""Error when trying to call rootwrap drv_cfg"""
|
||||
raise putils.ProcessExecutionError("Test missing drv_cfg.")
|
||||
|
||||
def handle_scaleio_request(self, url, *args, **kwargs):
|
||||
def handle_vxflexos_request(self, url, *args, **kwargs):
|
||||
"""Fake REST server"""
|
||||
api_call = url.split(':', 2)[2].split('/', 1)[1].replace('api/', '')
|
||||
|
||||
|
@ -152,7 +152,7 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
self.assertEqual(expected, actual)
|
||||
|
||||
@mock.patch.object(os.path, 'exists', return_value=True)
|
||||
@mock.patch.object(scaleio.ScaleIOConnector, '_wait_for_volume_path')
|
||||
@mock.patch.object(vxflexos.VxFlexOsConnector, '_wait_for_volume_path')
|
||||
def test_get_volume_paths(self, mock_wait_for_path, mock_exists):
|
||||
mock_wait_for_path.return_value = "emc-vol-vol1"
|
||||
expected = ['/dev/disk/by-id/emc-vol-vol1']
|
||||
|
@ -161,7 +161,7 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
self.assertEqual(expected, actual)
|
||||
|
||||
def test_get_connector_properties(self):
|
||||
props = scaleio.ScaleIOConnector.get_connector_properties(
|
||||
props = vxflexos.VxFlexOsConnector.get_connector_properties(
|
||||
'sudo', multipath=True, enforce_multipath=True)
|
||||
|
||||
expected_props = {}
|
||||
|
@ -193,7 +193,7 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
|
||||
def test_error_id(self):
|
||||
"""Fail to connect with bad volume name"""
|
||||
self.fake_connection_properties['scaleIO_volume_id'] = 'bad_id'
|
||||
self.fake_connection_properties['vxflexos_volume_id'] = 'bad_id'
|
||||
self.mock_calls[self.get_volume_api] = self.MockHTTPSResponse(
|
||||
dict(errorCode='404', message='Test volume not found'), 404)
|
||||
|
||||
|
@ -201,7 +201,7 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
|
||||
def test_error_no_volume_id(self):
|
||||
"""Faile to connect with no volume id"""
|
||||
self.fake_connection_properties['scaleIO_volume_id'] = None
|
||||
self.fake_connection_properties['vxflexos_volume_id'] = None
|
||||
self.mock_calls[self.get_volume_api] = self.MockHTTPSResponse(
|
||||
'null', 200)
|
||||
|
||||
|
@ -268,8 +268,8 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
|||
self.test_disconnect_volume()
|
||||
|
||||
@mock.patch.object(os.path, 'exists', return_value=True)
|
||||
@mock.patch.object(scaleio.ScaleIOConnector, '_find_volume_path')
|
||||
@mock.patch.object(scaleio.ScaleIOConnector, 'get_device_size')
|
||||
@mock.patch.object(vxflexos.VxFlexOsConnector, '_find_volume_path')
|
||||
@mock.patch.object(vxflexos.VxFlexOsConnector, 'get_device_size')
|
||||
def test_extend_volume(self,
|
||||
mock_device_size,
|
||||
mock_find_volume_path,
|
|
@ -253,10 +253,6 @@ class ConnectorTestCase(test_base.TestCase):
|
|||
'huaweisdshypervisor', None, arch='x86_64')
|
||||
self.assertEqual("HuaweiStorHyperConnector", obj.__class__.__name__)
|
||||
|
||||
obj = connector.InitiatorConnector.factory(
|
||||
"scaleio", None, arch='x86_64')
|
||||
self.assertEqual("ScaleIOConnector", obj.__class__.__name__)
|
||||
|
||||
obj = connector.InitiatorConnector.factory(
|
||||
'quobyte', None, quobyte_mount_point_base='/mnt/test',
|
||||
arch='x86_64')
|
||||
|
@ -266,6 +262,15 @@ class ConnectorTestCase(test_base.TestCase):
|
|||
"disco", None, arch='x86_64')
|
||||
self.assertEqual("DISCOConnector", obj.__class__.__name__)
|
||||
|
||||
obj = connector.InitiatorConnector.factory(
|
||||
"vxflexos", None, arch='x86_64')
|
||||
self.assertEqual("VxFlexOsConnector", obj.__class__.__name__)
|
||||
|
||||
# check deprecated protocol mapping
|
||||
obj = connector.InitiatorConnector.factory(
|
||||
"scaleio", None, arch='x86_64')
|
||||
self.assertEqual("VxFlexOsConnector", obj.__class__.__name__)
|
||||
|
||||
self.assertRaises(exception.InvalidConnectorProtocol,
|
||||
connector.InitiatorConnector.factory,
|
||||
"bogus", None)
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
|
||||
upgrade:
|
||||
- |
|
||||
Dell EMC ScaleIO has been rebranded to VxFlex OS.
|
||||
To follow this changes "scaleio" protocol renamed to "vxflexos",
|
||||
"ScaleIOConnector" class renamed to "VxFlexOsConnector".
|
||||
Old names will continue to work but will be removed in the Train
|
||||
release.
|
||||
|
||||
deprecations:
|
||||
- |
|
||||
The "scaleio" protocol was renamed and is deprecated now, it will
|
||||
be removed in the Train release. New protocol name is "vxflexos".
|
Loading…
Reference in New Issue