Merge "VNX: fix options incorrect behavior"

This commit is contained in:
Zuul 2018-03-26 18:11:42 +00:00 committed by Gerrit Code Review
commit 8a0f2a6618
9 changed files with 42 additions and 3 deletions

View File

@ -1181,6 +1181,10 @@ test_add_lun_to_ioclass:
_methods: _methods:
get_ioclass: *ioclass_true get_ioclass: *ioclass_true
test_set_max_luns_per_sg:
vnx: *vnx_base
########################################################### ###########################################################
# TestCommonAdapter # TestCommonAdapter
########################################################### ###########################################################

View File

@ -576,3 +576,9 @@ class TestClient(test.TestCase):
@res_mock.patch_client @res_mock.patch_client
def test_add_lun_to_ioclass(self, client, mocked): def test_add_lun_to_ioclass(self, client, mocked):
client.add_lun_to_ioclass('test_ioclass', 1) 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)

View File

@ -30,6 +30,9 @@ patch_sleep = mock.patch('time.sleep')
patch_vnxsystem = mock.patch('storops.VNXSystem') patch_vnxsystem = mock.patch('storops.VNXSystem')
patch_vnxstoragegroup = mock.patch('storops.vnx.resource.sg.VNXStorageGroup')
def load_yaml(file_name): def load_yaml(file_name):
yaml_file = '{}/{}'.format(path.dirname( yaml_file = '{}/{}'.format(path.dirname(
path.abspath(__file__)), file_name) path.abspath(__file__)), file_name)

View File

@ -61,6 +61,7 @@ class CommonAdapter(replication.ReplicationAdapter):
self.allowed_ports = None self.allowed_ports = None
self.force_delete_lun_in_sg = None self.force_delete_lun_in_sg = None
self.max_over_subscription_ratio = None self.max_over_subscription_ratio = None
self.max_luns_per_storage_group = None
self.ignore_pool_full_threshold = None self.ignore_pool_full_threshold = None
self.reserved_percentage = None self.reserved_percentage = None
self.destroy_empty_sg = None self.destroy_empty_sg = None
@ -81,6 +82,8 @@ class CommonAdapter(replication.ReplicationAdapter):
self._normalize_config() self._normalize_config()
self.client = self._build_client_from_config( self.client = self._build_client_from_config(
self.config, self.queue_path) self.config, self.queue_path)
self.client.set_max_luns_per_sg(
self.config.max_luns_per_storage_group)
# Replication related # Replication related
if (self.active_backend_id in if (self.active_backend_id in
common.ReplicationDeviceList.get_backend_ids(self.config)): common.ReplicationDeviceList.get_backend_ids(self.config)):

View File

@ -733,3 +733,8 @@ class Client(object):
def filter_sg(self, attached_lun_id): def filter_sg(self, attached_lun_id):
return self.vnx.get_sg().shadow_copy(attached_lun=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)

View File

@ -97,8 +97,9 @@ VNX_OPTS = [
'By default, the value is False.'), 'By default, the value is False.'),
cfg.BoolOpt('check_max_pool_luns_threshold', cfg.BoolOpt('check_max_pool_luns_threshold',
default=False, default=False,
help='Report free_capacity_gb as 0 when the limit to ' deprecated_for_removal=True,
'maximum number of pool LUNs is reached. ' 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.'), 'By default, the value is False.'),
cfg.BoolOpt('force_delete_lun_in_storagegroup', cfg.BoolOpt('force_delete_lun_in_storagegroup',
default=False, default=False,

View File

@ -78,9 +78,11 @@ class VNXDriver(driver.ManageableVD,
10.2.0 - Add replication group support 10.2.0 - Add replication group support
11.0.0 - Fix failure of migration during cloning 11.0.0 - Fix failure of migration during cloning
12.0.0 - Add `volume revert to snapshot` support 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' VENDOR = 'Dell EMC'
# ThirdPartySystems wiki page # ThirdPartySystems wiki page
CI_WIKI_NAME = "EMC_VNX_CI" CI_WIKI_NAME = "EMC_VNX_CI"

View File

@ -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 So the scheduler will be able to skip this kind of pool-based back end that
runs out of the pool volume number. 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 iSCSI initiators
---------------- ----------------

View File

@ -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.