Dell EMC: Moved SC driver under dell_emc

Moved driver from cinder/cinder/volume/drivers/dell to
cinder/cinder/volume/drivers/dell_emc/sc.

Removed Dell from the driver names and classes.

Test directory moved in a similar manner.

Fixed copyright.

Change-Id: I0dec53df462dbb6039ddbe96945c0ac334e0adb0
This commit is contained in:
Tom Swanson 2017-01-31 14:31:40 -06:00
parent 53e1bb3525
commit 1dde22e41f
12 changed files with 1185 additions and 1174 deletions

View File

@ -72,10 +72,10 @@ from cinder.volume.drivers.coprhd import scaleio as \
cinder_volume_drivers_coprhd_scaleio
from cinder.volume.drivers.datera import datera_iscsi as \
cinder_volume_drivers_datera_dateraiscsi
from cinder.volume.drivers.dell import dell_storagecenter_common as \
cinder_volume_drivers_dell_dellstoragecentercommon
from cinder.volume.drivers.dell_emc import ps as \
cinder_volume_drivers_dell_emc_ps
from cinder.volume.drivers.dell_emc.sc import storagecenter_common as \
cinder_volume_drivers_dell_emc_sc_storagecentercommon
from cinder.volume.drivers.dell_emc.scaleio import driver as \
cinder_volume_drivers_dell_emc_scaleio_driver
from cinder.volume.drivers.dell_emc.unity import driver as \
@ -276,9 +276,9 @@ def list_opts():
cinder_volume_drivers_coprhd_common.volume_opts,
cinder_volume_drivers_coprhd_scaleio.scaleio_opts,
cinder_volume_drivers_datera_dateraiscsi.d_opts,
cinder_volume_drivers_dell_dellstoragecentercommon.
common_opts,
cinder_volume_drivers_dell_emc_ps.eqlx_opts,
cinder_volume_drivers_dell_emc_sc_storagecentercommon.
common_opts,
cinder_volume_drivers_dell_emc_scaleio_driver.scaleio_opts,
cinder_volume_drivers_dell_emc_unity_driver.UNITY_OPTS,
cinder_volume_drivers_dell_emc_vmax_common.emc_opts,

View File

@ -18,18 +18,18 @@ from cinder import context
from cinder import exception
from cinder import test
from cinder.tests.unit import fake_constants as fake
from cinder.volume.drivers.dell import dell_storagecenter_api
from cinder.volume.drivers.dell import dell_storagecenter_fc
from cinder.volume.drivers.dell_emc.sc import storagecenter_api
from cinder.volume.drivers.dell_emc.sc import storagecenter_fc
# We patch these here as they are used by every test to keep
# from trying to contact a Dell Storage Center.
@mock.patch.object(dell_storagecenter_api.HttpClient,
@mock.patch.object(storagecenter_api.HttpClient,
'__init__',
return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'open_connection')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'close_connection')
class DellSCSanFCDriverTestCase(test.TestCase):
@ -145,7 +145,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
self.configuration.dell_sc_api_port = 3033
self._context = context.get_admin_context()
self.driver = dell_storagecenter_fc.DellStorageCenterFCDriver(
self.driver = storagecenter_fc.SCFCDriver(
configuration=self.configuration)
self.driver.do_setup(None)
@ -172,22 +172,22 @@ class DellSCSanFCDriverTestCase(test.TestCase):
'initiator': 'iqn.1993-08.org.debian:01:e1b1312f9e1',
'wwpns': ['21000024ff30441c', '21000024ff30441d']}
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'create_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'map_volume',
return_value=MAPPING)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(1,
[u'5000D31000FCBE3D',
@ -225,25 +225,25 @@ class DellSCSanFCDriverTestCase(test.TestCase):
mock_find_volume.assert_called_once_with(fake.VOLUME_ID, None, False)
mock_get_volume.assert_called_once_with(self.VOLUME[u'instanceId'])
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'map_volume',
return_value=MAPPING)
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver,
@mock.patch.object(storagecenter_fc.SCFCDriver,
'_is_live_vol')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns')
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver,
@mock.patch.object(storagecenter_fc.SCFCDriver,
'initialize_secondary')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_live_volume')
def test_initialize_connection_live_vol(self,
mock_get_live_volume,
@ -293,23 +293,23 @@ class DellSCSanFCDriverTestCase(test.TestCase):
mock_find_volume.assert_called_once_with(fake.VOLUME_ID, None, True)
mock_get_volume.assert_called_once_with(self.VOLUME[u'instanceId'])
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'map_volume',
return_value=MAPPING)
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver,
@mock.patch.object(storagecenter_fc.SCFCDriver,
'_is_live_vol')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns')
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver,
@mock.patch.object(storagecenter_fc.SCFCDriver,
'initialize_secondary')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_live_volume')
def test_initialize_connection_live_vol_afo(self,
mock_get_live_volume,
@ -361,19 +361,19 @@ class DellSCSanFCDriverTestCase(test.TestCase):
fake.VOLUME_ID, '101.101', True)
mock_get_volume.assert_called_once_with('102.101')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'map_volume',
return_value=MAPPING)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(None, [], {}))
def test_initialize_connection_no_wwns(self,
@ -392,19 +392,19 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume,
connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'create_server',
return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'map_volume',
return_value=MAPPING)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(None, [], {}))
def test_initialize_connection_no_server(self,
@ -423,16 +423,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume,
connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'map_volume',
return_value=MAPPING)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(None, [], {}))
def test_initialize_connection_vol_not_found(self,
@ -450,16 +450,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume,
connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'map_volume',
return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(None, [], {}))
def test_initialize_connection_map_vol_fail(self,
@ -573,16 +573,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
expected = (None, [], {})
self.assertEqual(expected, ret)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'unmap_volume',
return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(1,
[u'5000D31000FCBE3D',
@ -591,7 +591,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'],
u'21000024FF30441D':
[u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume_count',
return_value=1)
def test_terminate_connection(self,
@ -611,16 +611,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
'data': {}}
self.assertEqual(expected, res, 'Unexpected return data')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'unmap_volume',
return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(1,
[u'5000D31000FCBE3D',
@ -629,12 +629,12 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'],
u'21000024FF30441D':
[u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume_count',
return_value=1)
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver,
@mock.patch.object(storagecenter_fc.SCFCDriver,
'_is_live_vol')
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver,
@mock.patch.object(storagecenter_fc.SCFCDriver,
'terminate_secondary')
def test_terminate_connection_live_vol(self,
mock_terminate_secondary,
@ -657,16 +657,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
'data': {}}
self.assertEqual(expected, res, 'Unexpected return data')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'unmap_volume',
return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(1,
[u'5000D31000FCBE3D',
@ -675,7 +675,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'],
u'21000024FF30441D':
[u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume_count',
return_value=1)
def test_terminate_connection_no_server(self,
@ -694,16 +694,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume,
connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'unmap_volume',
return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(1,
[u'5000D31000FCBE3D',
@ -712,7 +712,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'],
u'21000024FF30441D':
[u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume_count',
return_value=1)
def test_terminate_connection_no_volume(self,
@ -731,21 +731,21 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume,
connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'unmap_volume',
return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(None,
[],
{}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume_count',
return_value=1)
def test_terminate_connection_no_wwns(self,
@ -764,16 +764,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
'data': {}}
self.assertEqual(expected, res, 'Unexpected return data')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'unmap_volume',
return_value=False)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(1,
[u'5000D31000FCBE3D',
@ -782,7 +782,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'],
u'21000024FF30441D':
[u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume_count',
return_value=1)
def test_terminate_connection_failure(self,
@ -801,16 +801,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume,
connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_server',
return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_volume',
return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'unmap_volume',
return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'find_wwns',
return_value=(1,
[u'5000D31000FCBE3D',
@ -819,7 +819,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'],
u'21000024FF30441D':
[u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_volume_count',
return_value=0)
def test_terminate_connection_vol_count_zero(self,
@ -863,7 +863,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
expected = (None, [], {})
self.assertEqual(expected, ret)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_storage_usage',
return_value={'availableSpace': 100, 'freeSpace': 50})
def test_update_volume_stats_with_refresh(self,
@ -875,7 +875,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
self.assertEqual('FC', stats['storage_protocol'])
mock_get_storage_usage.assert_called_once_with()
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
@mock.patch.object(storagecenter_api.SCApi,
'get_storage_usage',
return_value={'availableSpace': 100, 'freeSpace': 50})
def test_get_volume_stats_no_refresh(self,

View File

@ -1,4 +1,4 @@
# Copyright 2016 Dell Inc.
# Copyright (c) 2015-2017 Dell Inc, or its subsidiaries.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -176,7 +176,7 @@ class HttpClient(object):
# r.content blanks.
# Object returned switches to one without objectType or with
# a different objectType.
if not StorageCenterApi._check_result(r):
if not SCApi._check_result(r):
LOG.debug('Async error:\n'
'\tstatus_code: %(code)s\n'
'\ttext: %(text)s\n',
@ -273,8 +273,8 @@ class HttpClient(object):
self.session.delete(self.__formatUrl(url), **named), async)
class StorageCenterApiHelper(object):
"""StorageCenterApiHelper
class SCApiHelper(object):
"""SCApiHelper
Helper class for API access. Handles opening and closing the
connection to the Dell REST API.
@ -328,12 +328,12 @@ class StorageCenterApiHelper(object):
def _setup_connection(self):
"""Attempts to open a connection to the storage center."""
connection = StorageCenterApi(self.san_ip,
self.san_port,
self.san_login,
self.san_password,
self.config.dell_sc_verify_cert,
self.apiversion)
connection = SCApi(self.san_ip,
self.san_port,
self.san_login,
self.san_password,
self.config.dell_sc_verify_cert,
self.apiversion)
# This instance is for a single backend. That backend has a
# few items of information we should save rather than passing them
# about.
@ -357,9 +357,9 @@ class StorageCenterApiHelper(object):
return connection
def open_connection(self):
"""Creates the StorageCenterApi object.
"""Creates the SCApi object.
:return: StorageCenterApi object.
:return: SCApi object.
:raises VolumeBackendAPIException:
"""
connection = None
@ -390,8 +390,8 @@ class StorageCenterApiHelper(object):
return connection
class StorageCenterApi(object):
"""StorageCenterApi
class SCApi(object):
"""SCApi
Handles calls to Dell SC and EM via the REST API interface.
@ -416,10 +416,11 @@ class StorageCenterApi(object):
3.5.0 - Support for AFO.
3.6.0 - Server type support.
3.7.0 - Support for Data Reduction, Group QOS and Volume QOS.
4.0.0 - Driver moved to dell_emc.
"""
APIDRIVERVERSION = '3.7.0'
APIDRIVERVERSION = '4.0.0'
def __init__(self, host, port, user, password, verify, apiversion):
"""This creates a connection to Dell SC or EM.

View File

@ -1,4 +1,4 @@
# Copyright 2016 Dell Inc.
# Copyright (c) 2015-2017 Dell Inc, or its subsidiaries.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -23,12 +23,11 @@ from cinder import exception
from cinder.i18n import _
from cinder.objects import fields
from cinder.volume import driver
from cinder.volume.drivers.dell import dell_storagecenter_api
from cinder.volume.drivers.dell_emc.sc import storagecenter_api
from cinder.volume.drivers.san.san import san_opts
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
common_opts = [
cfg.IntOpt('dell_sc_ssn',
default=64702,
@ -74,12 +73,12 @@ CONF = cfg.CONF
CONF.register_opts(common_opts)
class DellCommonDriver(driver.ManageableVD,
driver.ManageableSnapshotsVD,
driver.BaseVD):
class SCCommonDriver(driver.ManageableVD,
driver.ManageableSnapshotsVD,
driver.BaseVD):
def __init__(self, *args, **kwargs):
super(DellCommonDriver, self).__init__(*args, **kwargs)
super(SCCommonDriver, self).__init__(*args, **kwargs)
self.configuration.append_config_values(common_opts)
self.configuration.append_config_values(san_opts)
self.backend_name =\
@ -120,7 +119,7 @@ class DellCommonDriver(driver.ManageableVD,
Sets up clients, check licenses, sets up protocol
specific helpers.
"""
self._client = dell_storagecenter_api.StorageCenterApiHelper(
self._client = storagecenter_api.SCApiHelper(
self.configuration, self.active_backend_id, self.storage_protocol)
def check_for_setup_error(self):
@ -358,7 +357,7 @@ class DellCommonDriver(driver.ManageableVD,
def _delete_live_volume(self, api, volume):
"""Delete live volume associated with volume.
:param api:Dell REST API object.
:param api: Dell REST API object.
:param volume: Cinder Volume object
:return: True if we actually deleted something. False for everything
else.
@ -704,7 +703,7 @@ class DellCommonDriver(driver.ManageableVD,
# Static stats.
data = {}
data['volume_backend_name'] = self.backend_name
data['vendor_name'] = 'Dell'
data['vendor_name'] = 'Dell EMC'
data['driver_version'] = self.VERSION
data['storage_protocol'] = self.storage_protocol
data['reserved_percentage'] = 0
@ -1391,7 +1390,7 @@ class DellCommonDriver(driver.ManageableVD,
def _parse_secondary(self, api, secondary):
"""Find the replication destination associated with secondary.
:param api: Dell StorageCenterApi
:param api: Dell SCApi
:param secondary: String indicating the secondary to failover to.
:return: Destination SSN for the given secondary.
"""
@ -1950,7 +1949,7 @@ class DellCommonDriver(driver.ManageableVD,
with self._client.open_connection() as api:
screplay = self._get_unmanaged_replay(api, volume_name,
provider_id, existing_ref)
sz, rem = dell_storagecenter_api.StorageCenterApi.size_to_gb(
sz, rem = storagecenter_api.SCApi.size_to_gb(
screplay['size'])
if rem > 0:
raise exception.VolumeBackendAPIException(

View File

@ -1,4 +1,4 @@
# Copyright 2015 Dell Inc.
# Copyright (c) 2015-2017 Dell Inc, or its subsidiaries.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -21,21 +21,21 @@ from cinder import exception
from cinder.i18n import _
from cinder import interface
from cinder.volume import driver
from cinder.volume.drivers.dell import dell_storagecenter_common
from cinder.volume.drivers.dell_emc.sc import storagecenter_common
from cinder.zonemanager import utils as fczm_utils
LOG = logging.getLogger(__name__)
@interface.volumedriver
class DellStorageCenterFCDriver(dell_storagecenter_common.DellCommonDriver,
driver.FibreChannelDriver):
class SCFCDriver(storagecenter_common.SCCommonDriver,
driver.FibreChannelDriver):
"""Implements commands for Dell Storage Center FC management.
To enable the driver add the following line to the cinder configuration:
volume_driver=cinder.volume.drivers.dell.dell_storagecenter_fc.\
DellStorageCenterFCDriver
volume_driver=cinder.volume.drivers.dell_emc.sc.dell_storagecenter_fc.\
SCFCDriver
Version history:
@ -61,15 +61,16 @@ class DellStorageCenterFCDriver(dell_storagecenter_common.DellCommonDriver,
3.5.0 - Support for AFO.
3.6.0 - Server type support.
3.7.0 - Support for Data Reduction, Group QOS and Volume QOS.
4.0.0 - Driver moved to dell_emc.
"""
VERSION = '3.7.0'
VERSION = '4.0.0'
CI_WIKI_NAME = "Dell_Storage_CI"
def __init__(self, *args, **kwargs):
super(DellStorageCenterFCDriver, self).__init__(*args, **kwargs)
super(SCFCDriver, self).__init__(*args, **kwargs)
self.backend_name =\
self.configuration.safe_get('volume_backend_name') or 'Dell-FC'
self.storage_protocol = 'FC'

View File

@ -1,4 +1,4 @@
# Copyright 2015 Dell Inc.
# Copyright (c) 2015-2017 Dell Inc, or its subsidiaries.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -21,19 +21,20 @@ from cinder import exception
from cinder.i18n import _
from cinder import interface
from cinder.volume import driver
from cinder.volume.drivers.dell import dell_storagecenter_common
from cinder.volume.drivers.dell_emc.sc import storagecenter_common
LOG = logging.getLogger(__name__)
@interface.volumedriver
class DellStorageCenterISCSIDriver(dell_storagecenter_common.DellCommonDriver,
driver.ISCSIDriver):
class SCISCSIDriver(storagecenter_common.SCCommonDriver,
driver.ISCSIDriver):
"""Implements commands for Dell Storage Center ISCSI management.
To enable the driver add the following line to the cinder configuration:
volume_driver=cinder.volume.drivers.dell.dell_storagecenter_iscsi.\
DellStorageCenterISCSIDriver
volume_driver=cinder.volume.drivers.dell_emc.sc.\
dell_storagecenter_iscsi.SCISCSIDriver
Version history:
@ -60,14 +61,15 @@ class DellStorageCenterISCSIDriver(dell_storagecenter_common.DellCommonDriver,
3.5.0 - Support for AFO.
3.6.0 - Server type support.
3.7.0 - Support for Data Reduction, Group QOS and Volume QOS.
4.0.0 - Driver moved to dell_emc.
"""
VERSION = '3.7.0'
VERSION = '4.0.0'
CI_WIKI_NAME = "Dell_Storage_CI"
def __init__(self, *args, **kwargs):
super(DellStorageCenterISCSIDriver, self).__init__(*args, **kwargs)
super(SCISCSIDriver, self).__init__(*args, **kwargs)
self.backend_name = (
self.configuration.safe_get('volume_backend_name') or 'Dell-iSCSI')

View File

@ -167,6 +167,14 @@ MAPPING = {
'cinder.volume.drivers.dell_emc.vmax.fc.VMAXFCDriver',
'cinder.volume.drivers.eqlx.DellEQLSanISCSIDriver':
'cinder.volume.drivers.dell_emc.ps.PSSeriesISCSIDriver',
'cinder.volume.drivers.dell.dell_storagecenter_iscsi.'
'DellStorageCenterISCSIDriver':
'cinder.volume.drivers.dell_emc.sc.storagecenter_iscsi.'
'SCISCSIDriver',
'cinder.volume.drivers.dell.dell_storagecenter_fc.'
'DellStorageCenterFCDriver':
'cinder.volume.drivers.dell_emc.sc.storagecenter_fc.'
'SCFCDriver',
}

View File

@ -0,0 +1,9 @@
---
upgrades:
- The Dell Storage Center driver is moved to the dell_emc directory
and has been rebranded to its current Dell EMC SC name. The
volume_driver entry in cinder.conf needs to be changed to
``cinder.volume.drivers.dell_emc.sc.storagecenter_fc.SCFCDriver``
for FC or
``cinder.volume.drivers.dell_emc.sc.storagecenter_iscsi.SCISCSIDriver``
for ISCSI.