diff --git a/cinder/opts.py b/cinder/opts.py index d669a7eba66..32d1ef162f1 100644 --- a/cinder/opts.py +++ b/cinder/opts.py @@ -80,6 +80,8 @@ from cinder.volume.drivers.dell_emc.unity import driver as \ cinder_volume_drivers_dell_emc_unity_driver from cinder.volume.drivers.dell_emc.vnx import common as \ cinder_volume_drivers_dell_emc_vnx_common +from cinder.volume.drivers.dell_emc import xtremio as \ + cinder_volume_drivers_dell_emc_xtremio from cinder.volume.drivers.disco import disco as \ cinder_volume_drivers_disco_disco from cinder.volume.drivers.dothill import dothill_common as \ @@ -88,8 +90,6 @@ from cinder.volume.drivers import drbdmanagedrv as \ cinder_volume_drivers_drbdmanagedrv from cinder.volume.drivers.emc import emc_vmax_common as \ cinder_volume_drivers_emc_emcvmaxcommon -from cinder.volume.drivers.emc import xtremio as \ - cinder_volume_drivers_emc_xtremio from cinder.volume.drivers import eqlx as cinder_volume_drivers_eqlx from cinder.volume.drivers.falconstor import fss_common as \ cinder_volume_drivers_falconstor_fsscommon @@ -277,12 +277,12 @@ def list_opts(): cinder_volume_drivers_dell_emc_scaleio_driver.scaleio_opts, cinder_volume_drivers_dell_emc_unity_driver.UNITY_OPTS, cinder_volume_drivers_dell_emc_vnx_common.VNX_OPTS, + cinder_volume_drivers_dell_emc_xtremio.XTREMIO_OPTS, cinder_volume_drivers_disco_disco.disco_opts, cinder_volume_drivers_dothill_dothillcommon.common_opts, cinder_volume_drivers_dothill_dothillcommon.iscsi_opts, cinder_volume_drivers_drbdmanagedrv.drbd_opts, cinder_volume_drivers_emc_emcvmaxcommon.emc_opts, - cinder_volume_drivers_emc_xtremio.XTREMIO_OPTS, cinder_volume_drivers_eqlx.eqlx_opts, cinder_volume_drivers_falconstor_fsscommon.FSS_OPTS, cinder_volume_drivers_fujitsu_eternusdxcommon. diff --git a/cinder/tests/unit/volume/drivers/emc/test_emc_xtremio.py b/cinder/tests/unit/volume/drivers/dell_emc/test_xtremio.py similarity index 98% rename from cinder/tests/unit/volume/drivers/emc/test_emc_xtremio.py rename to cinder/tests/unit/volume/drivers/dell_emc/test_xtremio.py index bf59d5656e7..797cb1296ea 100644 --- a/cinder/tests/unit/volume/drivers/emc/test_emc_xtremio.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/test_xtremio.py @@ -25,7 +25,7 @@ from cinder.tests.unit.consistencygroup import fake_consistencygroup as fake_cg from cinder.tests.unit import fake_constants as fake from cinder.tests.unit import fake_snapshot from cinder.tests.unit.fake_volume import fake_volume_obj -from cinder.volume.drivers.emc import xtremio +from cinder.volume.drivers.dell_emc import xtremio typ2id = {'volumes': 'vol-id', @@ -313,9 +313,9 @@ class CommonData(object): cgsnapshot.__getitem__ = cgsnap_getitem -class BaseEMCXIODriverTestCase(test.TestCase): +class BaseXtremIODriverTestCase(test.TestCase): def __init__(self, *args, **kwargs): - super(BaseEMCXIODriverTestCase, self).__init__(*args, **kwargs) + super(BaseXtremIODriverTestCase, self).__init__(*args, **kwargs) self.config = mock.Mock(san_login = '', san_password = '', san_ip = '', @@ -332,7 +332,7 @@ class BaseEMCXIODriverTestCase(test.TestCase): self.config.safe_get = safe_get def setUp(self): - super(BaseEMCXIODriverTestCase, self).setUp() + super(BaseXtremIODriverTestCase, self).setUp() clean_xms_data() self.driver = xtremio.XtremIOISCSIDriver(configuration=self.config) @@ -342,8 +342,8 @@ class BaseEMCXIODriverTestCase(test.TestCase): self.data = CommonData() -@mock.patch('cinder.volume.drivers.emc.xtremio.XtremIOClient.req') -class EMCXIODriverISCSITestCase(BaseEMCXIODriverTestCase): +@mock.patch('cinder.volume.drivers.dell_emc.xtremio.XtremIOClient.req') +class XtremIODriverISCSITestCase(BaseXtremIODriverTestCase): # ##### SetUp Check ##### def test_check_for_setup_error(self, req): req.side_effect = xms_request @@ -940,7 +940,7 @@ class EMCXIODriverISCSITestCase(BaseEMCXIODriverTestCase): @mock.patch('requests.request') -class EMCXIODriverTestCase(BaseEMCXIODriverTestCase): +class XtremIODriverTestCase(BaseXtremIODriverTestCase): # ##### XMS Client ##### @mock.patch.object(time, 'sleep', mock.Mock(return_value=0)) def test_retry_request(self, req): @@ -953,11 +953,11 @@ class EMCXIODriverTestCase(BaseEMCXIODriverTestCase): good_response = mock.MagicMock() good_response.status_code = 200 - EMCXIODriverTestCase.req_count = 0 + XtremIODriverTestCase.req_count = 0 def busy_request(*args, **kwargs): - if EMCXIODriverTestCase.req_count < 1: - EMCXIODriverTestCase.req_count += 1 + if XtremIODriverTestCase.req_count < 1: + XtremIODriverTestCase.req_count += 1 return busy_response return good_response @@ -976,11 +976,11 @@ class EMCXIODriverTestCase(BaseEMCXIODriverTestCase): self.driver.client.req('volumes') -@mock.patch('cinder.volume.drivers.emc.xtremio.XtremIOClient.req') -class EMCXIODriverFibreChannelTestCase(BaseEMCXIODriverTestCase): +@mock.patch('cinder.volume.drivers.dell_emc.xtremio.XtremIOClient.req') +class XtremIODriverFCTestCase(BaseXtremIODriverTestCase): def setUp(self): - super(EMCXIODriverFibreChannelTestCase, self).setUp() - self.driver = xtremio.XtremIOFibreChannelDriver( + super(XtremIODriverFCTestCase, self).setUp() + self.driver = xtremio.XtremIOFCDriver( configuration=self.config) # ##### Connection FC##### diff --git a/cinder/volume/drivers/emc/xtremio.py b/cinder/volume/drivers/dell_emc/xtremio.py similarity index 99% rename from cinder/volume/drivers/emc/xtremio.py rename to cinder/volume/drivers/dell_emc/xtremio.py index de051a4ba8e..60dc38285e8 100644 --- a/cinder/volume/drivers/emc/xtremio.py +++ b/cinder/volume/drivers/dell_emc/xtremio.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. """ -Driver for EMC XtremIO Storage. +Driver for Dell EMC XtremIO Storage. supported XtremIO version 2.4 and up .. code-block:: none @@ -500,7 +500,7 @@ class XtremIOVolumeDriver(san.SanDriver): free_physical = physical_space - used_physical_space actual_prov = int(sys["vol-size"]) / units.Mi self._stats = {'volume_backend_name': self.backend_name, - 'vendor_name': 'EMC', + 'vendor_name': 'Dell EMC', 'driver_version': self.VERSION, 'storage_protocol': self.protocol, 'total_capacity_gb': physical_space, @@ -951,11 +951,11 @@ class XtremIOISCSIDriver(XtremIOVolumeDriver, driver.ISCSIDriver): @interface.volumedriver -class XtremIOFibreChannelDriver(XtremIOVolumeDriver, - driver.FibreChannelDriver): +class XtremIOFCDriver(XtremIOVolumeDriver, + driver.FibreChannelDriver): def __init__(self, *args, **kwargs): - super(XtremIOFibreChannelDriver, self).__init__(*args, **kwargs) + super(XtremIOFCDriver, self).__init__(*args, **kwargs) self.protocol = 'FC' self._targets = None @@ -1030,7 +1030,7 @@ class XtremIOFibreChannelDriver(XtremIOVolumeDriver, @fczm_utils.RemoveFCZone def terminate_connection(self, volume, connector, **kwargs): - (super(XtremIOFibreChannelDriver, self) + (super(XtremIOFCDriver, self) .terminate_connection(volume, connector, **kwargs)) num_vols = (self.client .num_of_mapped_volumes(self._get_ig_name(connector))) diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 6247a7bd8cf..4d8f695248b 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -152,7 +152,11 @@ MAPPING = { 'cinder.volume.drivers.emc.scaleio': 'cinder.volume.drivers.dell_emc.scaleio.driver', 'cinder.volume.drivers.emc.vnx.driver.EMCVNXDriver': - 'cinder.volume.drivers.dell_emc.vnx.driver.VNXDriver' + 'cinder.volume.drivers.dell_emc.vnx.driver.VNXDriver', + 'cinder.volume.drivers.emc.xtremio.XtremIOISCSIDriver': + 'cinder.volume.drivers.dell_emc.xtremio.XtremIOISCSIDriver', + 'cinder.volume.drivers.emc.xtremio.XtremIOFibreChannelDriver': + 'cinder.volume.drivers.dell_emc.xtremio.XtremIOFCDriver', } diff --git a/releasenotes/notes/move-xtremio-driver-to-dell-emc-dir-f7e07a502cafd78f.yaml b/releasenotes/notes/move-xtremio-driver-to-dell-emc-dir-f7e07a502cafd78f.yaml new file mode 100644 index 00000000000..7fc058179e5 --- /dev/null +++ b/releasenotes/notes/move-xtremio-driver-to-dell-emc-dir-f7e07a502cafd78f.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - The XtremIO driver is moved to the dell_emc directory. + volume_driver entry in cinder.conf needs to be changed to + cinder.volume.drivers.dell_emc.xtremio.XtremIOISCSIDriver or + cinder.volume.drivers.dell_emc.xtremio.XtremIOFCDriver.