diff --git a/cinder/tests/unit/volume/drivers/dell_emc/vnx/mocked_vnx.yaml b/cinder/tests/unit/volume/drivers/dell_emc/vnx/mocked_vnx.yaml index 5b97679d6aa..12a1d6f1d12 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/vnx/mocked_vnx.yaml +++ b/cinder/tests/unit/volume/drivers/dell_emc/vnx/mocked_vnx.yaml @@ -1181,6 +1181,10 @@ test_add_lun_to_ioclass: _methods: get_ioclass: *ioclass_true +test_set_max_luns_per_sg: + vnx: *vnx_base + + ########################################################### # TestCommonAdapter ########################################################### diff --git a/cinder/tests/unit/volume/drivers/dell_emc/vnx/test_client.py b/cinder/tests/unit/volume/drivers/dell_emc/vnx/test_client.py index c76b1f2d8ec..4df99f01499 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/vnx/test_client.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/vnx/test_client.py @@ -576,3 +576,9 @@ class TestClient(test.TestCase): @res_mock.patch_client def test_add_lun_to_ioclass(self, client, mocked): client.add_lun_to_ioclass('test_ioclass', 1) + + @res_mock.patch_client + def test_set_max_luns_per_sg(self, client, mocked): + with utils.patch_vnxstoragegroup as patch_sg: + client.set_max_luns_per_sg(300) + patch_sg.set_max_luns_per_sg.assert_called_with(300) diff --git a/cinder/tests/unit/volume/drivers/dell_emc/vnx/utils.py b/cinder/tests/unit/volume/drivers/dell_emc/vnx/utils.py index ec567a2e5aa..9b7deb05ea9 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/vnx/utils.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/vnx/utils.py @@ -30,6 +30,9 @@ patch_sleep = mock.patch('time.sleep') patch_vnxsystem = mock.patch('storops.VNXSystem') +patch_vnxstoragegroup = mock.patch('storops.vnx.resource.sg.VNXStorageGroup') + + def load_yaml(file_name): yaml_file = '{}/{}'.format(path.dirname( path.abspath(__file__)), file_name) diff --git a/cinder/volume/drivers/dell_emc/vnx/adapter.py b/cinder/volume/drivers/dell_emc/vnx/adapter.py index bcd85f656d9..a00e45709d7 100644 --- a/cinder/volume/drivers/dell_emc/vnx/adapter.py +++ b/cinder/volume/drivers/dell_emc/vnx/adapter.py @@ -61,6 +61,7 @@ class CommonAdapter(replication.ReplicationAdapter): self.allowed_ports = None self.force_delete_lun_in_sg = None self.max_over_subscription_ratio = None + self.max_luns_per_storage_group = None self.ignore_pool_full_threshold = None self.reserved_percentage = None self.destroy_empty_sg = None @@ -81,6 +82,8 @@ class CommonAdapter(replication.ReplicationAdapter): self._normalize_config() self.client = self._build_client_from_config( self.config, self.queue_path) + self.client.set_max_luns_per_sg( + self.config.max_luns_per_storage_group) # Replication related if (self.active_backend_id in common.ReplicationDeviceList.get_backend_ids(self.config)): diff --git a/cinder/volume/drivers/dell_emc/vnx/client.py b/cinder/volume/drivers/dell_emc/vnx/client.py index d1c3dbbfce1..abbafc71c39 100644 --- a/cinder/volume/drivers/dell_emc/vnx/client.py +++ b/cinder/volume/drivers/dell_emc/vnx/client.py @@ -733,3 +733,8 @@ class Client(object): def filter_sg(self, attached_lun_id): return self.vnx.get_sg().shadow_copy(attached_lun=attached_lun_id) + + def set_max_luns_per_sg(self, max_luns): + """Sets max LUNs per storage group.""" + storops.vnx.resource.sg.VNXStorageGroup.set_max_luns_per_sg(max_luns) + LOG.info('Set max LUNs per storage group to %s.', max_luns) diff --git a/cinder/volume/drivers/dell_emc/vnx/common.py b/cinder/volume/drivers/dell_emc/vnx/common.py index 6c3afac8e87..3e93445fde7 100644 --- a/cinder/volume/drivers/dell_emc/vnx/common.py +++ b/cinder/volume/drivers/dell_emc/vnx/common.py @@ -97,8 +97,9 @@ VNX_OPTS = [ 'By default, the value is False.'), cfg.BoolOpt('check_max_pool_luns_threshold', default=False, - help='Report free_capacity_gb as 0 when the limit to ' - 'maximum number of pool LUNs is reached. ' + deprecated_for_removal=True, + help='DEPRECATED: Report free_capacity_gb as 0 when the limit ' + 'to maximum number of pool LUNs is reached. ' 'By default, the value is False.'), cfg.BoolOpt('force_delete_lun_in_storagegroup', default=False, diff --git a/cinder/volume/drivers/dell_emc/vnx/driver.py b/cinder/volume/drivers/dell_emc/vnx/driver.py index b3442848ca9..40c3c3eba37 100644 --- a/cinder/volume/drivers/dell_emc/vnx/driver.py +++ b/cinder/volume/drivers/dell_emc/vnx/driver.py @@ -78,9 +78,11 @@ class VNXDriver(driver.ManageableVD, 10.2.0 - Add replication group support 11.0.0 - Fix failure of migration during cloning 12.0.0 - Add `volume revert to snapshot` support + 12.1.0 - Adjust max_luns_per_storage_group and + check_max_pool_luns_threshold """ - VERSION = '12.00.00' + VERSION = '12.01.00' VENDOR = 'Dell EMC' # ThirdPartySystems wiki page CI_WIKI_NAME = "EMC_VNX_CI" diff --git a/doc/source/configuration/block-storage/drivers/dell-emc-vnx-driver.rst b/doc/source/configuration/block-storage/drivers/dell-emc-vnx-driver.rst index 14dc8c05c76..1189c3c2f6f 100644 --- a/doc/source/configuration/block-storage/drivers/dell-emc-vnx-driver.rst +++ b/doc/source/configuration/block-storage/drivers/dell-emc-vnx-driver.rst @@ -377,6 +377,11 @@ limit and will report 0 free capacity to the scheduler if the limit is reached. So the scheduler will be able to skip this kind of pool-based back end that runs out of the pool volume number. +.. note:: + + From Queens, ``check_max_pool_luns_threshold`` is obsolete. And the behavior + is like where ``check_max_pool_luns_threshold`` is set to ``True``. + iSCSI initiators ---------------- diff --git a/releasenotes/notes/add-option-max_luns_per_storage_group-dfe3e1396b262bc8.yaml b/releasenotes/notes/add-option-max_luns_per_storage_group-dfe3e1396b262bc8.yaml new file mode 100644 index 00000000000..8022452d32f --- /dev/null +++ b/releasenotes/notes/add-option-max_luns_per_storage_group-dfe3e1396b262bc8.yaml @@ -0,0 +1,10 @@ +--- +deprecations: + - | + Deprecate option `check_max_pool_luns_threshold`. The VNX driver will + always check the threshold. +fixes: + - | + Add option `max_luns_per_storage_group` back. The max LUNs per storage + group was set to 255 before. With the new option, admin can set it to a + larger number.