Merge "Dell EMC: Moved SC driver under dell_emc"

This commit is contained in:
Jenkins 2017-05-16 04:28:28 +00:00 committed by Gerrit Code Review
commit a570b061b8
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 cinder_volume_drivers_coprhd_scaleio
from cinder.volume.drivers.datera import datera_iscsi as \ from cinder.volume.drivers.datera import datera_iscsi as \
cinder_volume_drivers_datera_dateraiscsi 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 \ from cinder.volume.drivers.dell_emc import ps as \
cinder_volume_drivers_dell_emc_ps 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 \ from cinder.volume.drivers.dell_emc.scaleio import driver as \
cinder_volume_drivers_dell_emc_scaleio_driver cinder_volume_drivers_dell_emc_scaleio_driver
from cinder.volume.drivers.dell_emc.unity import driver as \ 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_common.volume_opts,
cinder_volume_drivers_coprhd_scaleio.scaleio_opts, cinder_volume_drivers_coprhd_scaleio.scaleio_opts,
cinder_volume_drivers_datera_dateraiscsi.d_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_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_scaleio_driver.scaleio_opts,
cinder_volume_drivers_dell_emc_unity_driver.UNITY_OPTS, cinder_volume_drivers_dell_emc_unity_driver.UNITY_OPTS,
cinder_volume_drivers_dell_emc_vmax_common.emc_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 exception
from cinder import test from cinder import test
from cinder.tests.unit import fake_constants as fake from cinder.tests.unit import fake_constants as fake
from cinder.volume.drivers.dell import dell_storagecenter_api from cinder.volume.drivers.dell_emc.sc import storagecenter_api
from cinder.volume.drivers.dell import dell_storagecenter_fc from cinder.volume.drivers.dell_emc.sc import storagecenter_fc
# We patch these here as they are used by every test to keep # We patch these here as they are used by every test to keep
# from trying to contact a Dell Storage Center. # from trying to contact a Dell Storage Center.
@mock.patch.object(dell_storagecenter_api.HttpClient, @mock.patch.object(storagecenter_api.HttpClient,
'__init__', '__init__',
return_value=None) return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'open_connection') 'open_connection')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'close_connection') 'close_connection')
class DellSCSanFCDriverTestCase(test.TestCase): class DellSCSanFCDriverTestCase(test.TestCase):
@ -145,7 +145,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
self.configuration.dell_sc_api_port = 3033 self.configuration.dell_sc_api_port = 3033
self._context = context.get_admin_context() self._context = context.get_admin_context()
self.driver = dell_storagecenter_fc.DellStorageCenterFCDriver( self.driver = storagecenter_fc.SCFCDriver(
configuration=self.configuration) configuration=self.configuration)
self.driver.do_setup(None) self.driver.do_setup(None)
@ -172,22 +172,22 @@ class DellSCSanFCDriverTestCase(test.TestCase):
'initiator': 'iqn.1993-08.org.debian:01:e1b1312f9e1', 'initiator': 'iqn.1993-08.org.debian:01:e1b1312f9e1',
'wwpns': ['21000024ff30441c', '21000024ff30441d']} 'wwpns': ['21000024ff30441c', '21000024ff30441d']}
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=None) return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'create_server', 'create_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume', 'get_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'map_volume', 'map_volume',
return_value=MAPPING) return_value=MAPPING)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(1, return_value=(1,
[u'5000D31000FCBE3D', [u'5000D31000FCBE3D',
@ -225,25 +225,25 @@ class DellSCSanFCDriverTestCase(test.TestCase):
mock_find_volume.assert_called_once_with(fake.VOLUME_ID, None, False) mock_find_volume.assert_called_once_with(fake.VOLUME_ID, None, False)
mock_get_volume.assert_called_once_with(self.VOLUME[u'instanceId']) 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', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume', 'get_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'map_volume', 'map_volume',
return_value=MAPPING) return_value=MAPPING)
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, @mock.patch.object(storagecenter_fc.SCFCDriver,
'_is_live_vol') '_is_live_vol')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns') 'find_wwns')
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, @mock.patch.object(storagecenter_fc.SCFCDriver,
'initialize_secondary') 'initialize_secondary')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_live_volume') 'get_live_volume')
def test_initialize_connection_live_vol(self, def test_initialize_connection_live_vol(self,
mock_get_live_volume, 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_find_volume.assert_called_once_with(fake.VOLUME_ID, None, True)
mock_get_volume.assert_called_once_with(self.VOLUME[u'instanceId']) 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', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume') 'find_volume')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume') 'get_volume')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'map_volume', 'map_volume',
return_value=MAPPING) return_value=MAPPING)
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, @mock.patch.object(storagecenter_fc.SCFCDriver,
'_is_live_vol') '_is_live_vol')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns') 'find_wwns')
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, @mock.patch.object(storagecenter_fc.SCFCDriver,
'initialize_secondary') 'initialize_secondary')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_live_volume') 'get_live_volume')
def test_initialize_connection_live_vol_afo(self, def test_initialize_connection_live_vol_afo(self,
mock_get_live_volume, mock_get_live_volume,
@ -361,19 +361,19 @@ class DellSCSanFCDriverTestCase(test.TestCase):
fake.VOLUME_ID, '101.101', True) fake.VOLUME_ID, '101.101', True)
mock_get_volume.assert_called_once_with('102.101') mock_get_volume.assert_called_once_with('102.101')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume', 'get_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'map_volume', 'map_volume',
return_value=MAPPING) return_value=MAPPING)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(None, [], {})) return_value=(None, [], {}))
def test_initialize_connection_no_wwns(self, def test_initialize_connection_no_wwns(self,
@ -392,19 +392,19 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume, volume,
connector) connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=None) return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'create_server', 'create_server',
return_value=None) return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'map_volume', 'map_volume',
return_value=MAPPING) return_value=MAPPING)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(None, [], {})) return_value=(None, [], {}))
def test_initialize_connection_no_server(self, def test_initialize_connection_no_server(self,
@ -423,16 +423,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume, volume,
connector) connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=None) return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'map_volume', 'map_volume',
return_value=MAPPING) return_value=MAPPING)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(None, [], {})) return_value=(None, [], {}))
def test_initialize_connection_vol_not_found(self, def test_initialize_connection_vol_not_found(self,
@ -450,16 +450,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume, volume,
connector) connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'map_volume', 'map_volume',
return_value=None) return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(None, [], {})) return_value=(None, [], {}))
def test_initialize_connection_map_vol_fail(self, def test_initialize_connection_map_vol_fail(self,
@ -573,16 +573,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
expected = (None, [], {}) expected = (None, [], {})
self.assertEqual(expected, ret) self.assertEqual(expected, ret)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'unmap_volume', 'unmap_volume',
return_value=True) return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(1, return_value=(1,
[u'5000D31000FCBE3D', [u'5000D31000FCBE3D',
@ -591,7 +591,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'], [u'5000D31000FCBE35'],
u'21000024FF30441D': u'21000024FF30441D':
[u'5000D31000FCBE3D']})) [u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume_count', 'get_volume_count',
return_value=1) return_value=1)
def test_terminate_connection(self, def test_terminate_connection(self,
@ -611,16 +611,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
'data': {}} 'data': {}}
self.assertEqual(expected, res, 'Unexpected return data') self.assertEqual(expected, res, 'Unexpected return data')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'unmap_volume', 'unmap_volume',
return_value=True) return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(1, return_value=(1,
[u'5000D31000FCBE3D', [u'5000D31000FCBE3D',
@ -629,12 +629,12 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'], [u'5000D31000FCBE35'],
u'21000024FF30441D': u'21000024FF30441D':
[u'5000D31000FCBE3D']})) [u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume_count', 'get_volume_count',
return_value=1) return_value=1)
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, @mock.patch.object(storagecenter_fc.SCFCDriver,
'_is_live_vol') '_is_live_vol')
@mock.patch.object(dell_storagecenter_fc.DellStorageCenterFCDriver, @mock.patch.object(storagecenter_fc.SCFCDriver,
'terminate_secondary') 'terminate_secondary')
def test_terminate_connection_live_vol(self, def test_terminate_connection_live_vol(self,
mock_terminate_secondary, mock_terminate_secondary,
@ -657,16 +657,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
'data': {}} 'data': {}}
self.assertEqual(expected, res, 'Unexpected return data') self.assertEqual(expected, res, 'Unexpected return data')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=None) return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'unmap_volume', 'unmap_volume',
return_value=True) return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(1, return_value=(1,
[u'5000D31000FCBE3D', [u'5000D31000FCBE3D',
@ -675,7 +675,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'], [u'5000D31000FCBE35'],
u'21000024FF30441D': u'21000024FF30441D':
[u'5000D31000FCBE3D']})) [u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume_count', 'get_volume_count',
return_value=1) return_value=1)
def test_terminate_connection_no_server(self, def test_terminate_connection_no_server(self,
@ -694,16 +694,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume, volume,
connector) connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=None) return_value=None)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'unmap_volume', 'unmap_volume',
return_value=True) return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(1, return_value=(1,
[u'5000D31000FCBE3D', [u'5000D31000FCBE3D',
@ -712,7 +712,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'], [u'5000D31000FCBE35'],
u'21000024FF30441D': u'21000024FF30441D':
[u'5000D31000FCBE3D']})) [u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume_count', 'get_volume_count',
return_value=1) return_value=1)
def test_terminate_connection_no_volume(self, def test_terminate_connection_no_volume(self,
@ -731,21 +731,21 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume, volume,
connector) connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'unmap_volume', 'unmap_volume',
return_value=True) return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(None, return_value=(None,
[], [],
{})) {}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume_count', 'get_volume_count',
return_value=1) return_value=1)
def test_terminate_connection_no_wwns(self, def test_terminate_connection_no_wwns(self,
@ -764,16 +764,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
'data': {}} 'data': {}}
self.assertEqual(expected, res, 'Unexpected return data') self.assertEqual(expected, res, 'Unexpected return data')
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'unmap_volume', 'unmap_volume',
return_value=False) return_value=False)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(1, return_value=(1,
[u'5000D31000FCBE3D', [u'5000D31000FCBE3D',
@ -782,7 +782,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'], [u'5000D31000FCBE35'],
u'21000024FF30441D': u'21000024FF30441D':
[u'5000D31000FCBE3D']})) [u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume_count', 'get_volume_count',
return_value=1) return_value=1)
def test_terminate_connection_failure(self, def test_terminate_connection_failure(self,
@ -801,16 +801,16 @@ class DellSCSanFCDriverTestCase(test.TestCase):
volume, volume,
connector) connector)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_server', 'find_server',
return_value=SCSERVER) return_value=SCSERVER)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_volume', 'find_volume',
return_value=VOLUME) return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'unmap_volume', 'unmap_volume',
return_value=True) return_value=True)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'find_wwns', 'find_wwns',
return_value=(1, return_value=(1,
[u'5000D31000FCBE3D', [u'5000D31000FCBE3D',
@ -819,7 +819,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
[u'5000D31000FCBE35'], [u'5000D31000FCBE35'],
u'21000024FF30441D': u'21000024FF30441D':
[u'5000D31000FCBE3D']})) [u'5000D31000FCBE3D']}))
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_volume_count', 'get_volume_count',
return_value=0) return_value=0)
def test_terminate_connection_vol_count_zero(self, def test_terminate_connection_vol_count_zero(self,
@ -863,7 +863,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
expected = (None, [], {}) expected = (None, [], {})
self.assertEqual(expected, ret) self.assertEqual(expected, ret)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_storage_usage', 'get_storage_usage',
return_value={'availableSpace': 100, 'freeSpace': 50}) return_value={'availableSpace': 100, 'freeSpace': 50})
def test_update_volume_stats_with_refresh(self, def test_update_volume_stats_with_refresh(self,
@ -875,7 +875,7 @@ class DellSCSanFCDriverTestCase(test.TestCase):
self.assertEqual('FC', stats['storage_protocol']) self.assertEqual('FC', stats['storage_protocol'])
mock_get_storage_usage.assert_called_once_with() mock_get_storage_usage.assert_called_once_with()
@mock.patch.object(dell_storagecenter_api.StorageCenterApi, @mock.patch.object(storagecenter_api.SCApi,
'get_storage_usage', 'get_storage_usage',
return_value={'availableSpace': 100, 'freeSpace': 50}) return_value={'availableSpace': 100, 'freeSpace': 50})
def test_get_volume_stats_no_refresh(self, 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 # 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 # not use this file except in compliance with the License. You may obtain
@ -176,7 +176,7 @@ class HttpClient(object):
# r.content blanks. # r.content blanks.
# Object returned switches to one without objectType or with # Object returned switches to one without objectType or with
# a different objectType. # a different objectType.
if not StorageCenterApi._check_result(r): if not SCApi._check_result(r):
LOG.debug('Async error:\n' LOG.debug('Async error:\n'
'\tstatus_code: %(code)s\n' '\tstatus_code: %(code)s\n'
'\ttext: %(text)s\n', '\ttext: %(text)s\n',
@ -273,8 +273,8 @@ class HttpClient(object):
self.session.delete(self.__formatUrl(url), **named), async) self.session.delete(self.__formatUrl(url), **named), async)
class StorageCenterApiHelper(object): class SCApiHelper(object):
"""StorageCenterApiHelper """SCApiHelper
Helper class for API access. Handles opening and closing the Helper class for API access. Handles opening and closing the
connection to the Dell REST API. connection to the Dell REST API.
@ -328,12 +328,12 @@ class StorageCenterApiHelper(object):
def _setup_connection(self): def _setup_connection(self):
"""Attempts to open a connection to the storage center.""" """Attempts to open a connection to the storage center."""
connection = StorageCenterApi(self.san_ip, connection = SCApi(self.san_ip,
self.san_port, self.san_port,
self.san_login, self.san_login,
self.san_password, self.san_password,
self.config.dell_sc_verify_cert, self.config.dell_sc_verify_cert,
self.apiversion) self.apiversion)
# This instance is for a single backend. That backend has a # This instance is for a single backend. That backend has a
# few items of information we should save rather than passing them # few items of information we should save rather than passing them
# about. # about.
@ -357,9 +357,9 @@ class StorageCenterApiHelper(object):
return connection return connection
def open_connection(self): def open_connection(self):
"""Creates the StorageCenterApi object. """Creates the SCApi object.
:return: StorageCenterApi object. :return: SCApi object.
:raises VolumeBackendAPIException: :raises VolumeBackendAPIException:
""" """
connection = None connection = None
@ -390,8 +390,8 @@ class StorageCenterApiHelper(object):
return connection return connection
class StorageCenterApi(object): class SCApi(object):
"""StorageCenterApi """SCApi
Handles calls to Dell SC and EM via the REST API interface. 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.5.0 - Support for AFO.
3.6.0 - Server type support. 3.6.0 - Server type support.
3.7.0 - Support for Data Reduction, Group QOS and Volume QOS. 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): def __init__(self, host, port, user, password, verify, apiversion):
"""This creates a connection to Dell SC or EM. """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 # 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 # 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.i18n import _
from cinder.objects import fields from cinder.objects import fields
from cinder.volume import driver 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.drivers.san.san import san_opts
from cinder.volume import utils as volume_utils from cinder.volume import utils as volume_utils
from cinder.volume import volume_types from cinder.volume import volume_types
common_opts = [ common_opts = [
cfg.IntOpt('dell_sc_ssn', cfg.IntOpt('dell_sc_ssn',
default=64702, default=64702,
@ -74,12 +73,12 @@ CONF = cfg.CONF
CONF.register_opts(common_opts) CONF.register_opts(common_opts)
class DellCommonDriver(driver.ManageableVD, class SCCommonDriver(driver.ManageableVD,
driver.ManageableSnapshotsVD, driver.ManageableSnapshotsVD,
driver.BaseVD): driver.BaseVD):
def __init__(self, *args, **kwargs): 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(common_opts)
self.configuration.append_config_values(san_opts) self.configuration.append_config_values(san_opts)
self.backend_name =\ self.backend_name =\
@ -120,7 +119,7 @@ class DellCommonDriver(driver.ManageableVD,
Sets up clients, check licenses, sets up protocol Sets up clients, check licenses, sets up protocol
specific helpers. specific helpers.
""" """
self._client = dell_storagecenter_api.StorageCenterApiHelper( self._client = storagecenter_api.SCApiHelper(
self.configuration, self.active_backend_id, self.storage_protocol) self.configuration, self.active_backend_id, self.storage_protocol)
def check_for_setup_error(self): def check_for_setup_error(self):
@ -358,7 +357,7 @@ class DellCommonDriver(driver.ManageableVD,
def _delete_live_volume(self, api, volume): def _delete_live_volume(self, api, volume):
"""Delete live volume associated with volume. """Delete live volume associated with volume.
:param api:Dell REST API object. :param api: Dell REST API object.
:param volume: Cinder Volume object :param volume: Cinder Volume object
:return: True if we actually deleted something. False for everything :return: True if we actually deleted something. False for everything
else. else.
@ -704,7 +703,7 @@ class DellCommonDriver(driver.ManageableVD,
# Static stats. # Static stats.
data = {} data = {}
data['volume_backend_name'] = self.backend_name data['volume_backend_name'] = self.backend_name
data['vendor_name'] = 'Dell' data['vendor_name'] = 'Dell EMC'
data['driver_version'] = self.VERSION data['driver_version'] = self.VERSION
data['storage_protocol'] = self.storage_protocol data['storage_protocol'] = self.storage_protocol
data['reserved_percentage'] = 0 data['reserved_percentage'] = 0
@ -1391,7 +1390,7 @@ class DellCommonDriver(driver.ManageableVD,
def _parse_secondary(self, api, secondary): def _parse_secondary(self, api, secondary):
"""Find the replication destination associated with 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. :param secondary: String indicating the secondary to failover to.
:return: Destination SSN for the given secondary. :return: Destination SSN for the given secondary.
""" """
@ -1950,7 +1949,7 @@ class DellCommonDriver(driver.ManageableVD,
with self._client.open_connection() as api: with self._client.open_connection() as api:
screplay = self._get_unmanaged_replay(api, volume_name, screplay = self._get_unmanaged_replay(api, volume_name,
provider_id, existing_ref) provider_id, existing_ref)
sz, rem = dell_storagecenter_api.StorageCenterApi.size_to_gb( sz, rem = storagecenter_api.SCApi.size_to_gb(
screplay['size']) screplay['size'])
if rem > 0: if rem > 0:
raise exception.VolumeBackendAPIException( 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 # 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 # 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.i18n import _
from cinder import interface from cinder import interface
from cinder.volume import driver 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 from cinder.zonemanager import utils as fczm_utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@interface.volumedriver @interface.volumedriver
class DellStorageCenterFCDriver(dell_storagecenter_common.DellCommonDriver, class SCFCDriver(storagecenter_common.SCCommonDriver,
driver.FibreChannelDriver): driver.FibreChannelDriver):
"""Implements commands for Dell Storage Center FC management. """Implements commands for Dell Storage Center FC management.
To enable the driver add the following line to the cinder configuration: To enable the driver add the following line to the cinder configuration:
volume_driver=cinder.volume.drivers.dell.dell_storagecenter_fc.\ volume_driver=cinder.volume.drivers.dell_emc.sc.dell_storagecenter_fc.\
DellStorageCenterFCDriver SCFCDriver
Version history: Version history:
@ -61,15 +61,16 @@ class DellStorageCenterFCDriver(dell_storagecenter_common.DellCommonDriver,
3.5.0 - Support for AFO. 3.5.0 - Support for AFO.
3.6.0 - Server type support. 3.6.0 - Server type support.
3.7.0 - Support for Data Reduction, Group QOS and Volume QOS. 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" CI_WIKI_NAME = "Dell_Storage_CI"
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(DellStorageCenterFCDriver, self).__init__(*args, **kwargs) super(SCFCDriver, self).__init__(*args, **kwargs)
self.backend_name =\ self.backend_name =\
self.configuration.safe_get('volume_backend_name') or 'Dell-FC' self.configuration.safe_get('volume_backend_name') or 'Dell-FC'
self.storage_protocol = '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 # 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 # 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.i18n import _
from cinder import interface from cinder import interface
from cinder.volume import driver 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__) LOG = logging.getLogger(__name__)
@interface.volumedriver @interface.volumedriver
class DellStorageCenterISCSIDriver(dell_storagecenter_common.DellCommonDriver, class SCISCSIDriver(storagecenter_common.SCCommonDriver,
driver.ISCSIDriver): driver.ISCSIDriver):
"""Implements commands for Dell Storage Center ISCSI management. """Implements commands for Dell Storage Center ISCSI management.
To enable the driver add the following line to the cinder configuration: To enable the driver add the following line to the cinder configuration:
volume_driver=cinder.volume.drivers.dell.dell_storagecenter_iscsi.\ volume_driver=cinder.volume.drivers.dell_emc.sc.\
DellStorageCenterISCSIDriver dell_storagecenter_iscsi.SCISCSIDriver
Version history: Version history:
@ -60,14 +61,15 @@ class DellStorageCenterISCSIDriver(dell_storagecenter_common.DellCommonDriver,
3.5.0 - Support for AFO. 3.5.0 - Support for AFO.
3.6.0 - Server type support. 3.6.0 - Server type support.
3.7.0 - Support for Data Reduction, Group QOS and Volume QOS. 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" CI_WIKI_NAME = "Dell_Storage_CI"
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(DellStorageCenterISCSIDriver, self).__init__(*args, **kwargs) super(SCISCSIDriver, self).__init__(*args, **kwargs)
self.backend_name = ( self.backend_name = (
self.configuration.safe_get('volume_backend_name') or 'Dell-iSCSI') 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.dell_emc.vmax.fc.VMAXFCDriver',
'cinder.volume.drivers.eqlx.DellEQLSanISCSIDriver': 'cinder.volume.drivers.eqlx.DellEQLSanISCSIDriver':
'cinder.volume.drivers.dell_emc.ps.PSSeriesISCSIDriver', '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.