[SVF]:Fix multiple lsiogrp,lsvdisk calls in Retype.
[Spectrum Virtualize Family] During Retype operation there are multiple lsiogrp and lsvdisk calls which can be optimized . This patch fixes can optimize ssh calls by caching the io_grp information and passing it as an argument to _verify_retype_params function which can remove get_volume_io_group function call inside _verify_retype_params . Closes Bug: #1951250 Change-Id: I98562783225523b6f7193edf499563b1b11daace
This commit is contained in:
parent
05d397bed1
commit
d49b001f13
cinder
tests/unit/volume/drivers/ibm
volume/drivers/ibm/storwize_svc
releasenotes/notes
@ -11160,7 +11160,10 @@ class StorwizeSVCReplicationTestCase(test.TestCase):
|
|||||||
self.driver.retype(self.ctxt, volume,
|
self.driver.retype(self.ctxt, volume,
|
||||||
new_type, diff, host)
|
new_type, diff, host)
|
||||||
|
|
||||||
def test_storwize_svc_retype_global_mirror_volume_to_thin(self):
|
@mock.patch.object(storwize_svc_common.StorwizeHelpers,
|
||||||
|
'get_volume_io_group')
|
||||||
|
def test_storwize_svc_retype_global_mirror_volume_to_thin(self,
|
||||||
|
get_vol_io_grp):
|
||||||
self.driver.do_setup(self.ctxt)
|
self.driver.do_setup(self.ctxt)
|
||||||
loc = ('StorwizeSVCDriver:' + self.driver._state['system_id'] +
|
loc = ('StorwizeSVCDriver:' + self.driver._state['system_id'] +
|
||||||
':openstack')
|
':openstack')
|
||||||
@ -11170,6 +11173,8 @@ class StorwizeSVCReplicationTestCase(test.TestCase):
|
|||||||
'capabilities': cap}
|
'capabilities': cap}
|
||||||
ctxt = context.get_admin_context()
|
ctxt = context.get_admin_context()
|
||||||
|
|
||||||
|
get_vol_io_grp.return_value = 0
|
||||||
|
|
||||||
type_name = 'rep_global_none'
|
type_name = 'rep_global_none'
|
||||||
spec = {'replication_enabled': '<is> True',
|
spec = {'replication_enabled': '<is> True',
|
||||||
'replication_type': '<in> global',
|
'replication_type': '<in> global',
|
||||||
@ -11201,6 +11206,7 @@ class StorwizeSVCReplicationTestCase(test.TestCase):
|
|||||||
self.driver.retype(self.ctxt, vol1, vol_type2, diff, host)
|
self.driver.retype(self.ctxt, vol1, vol_type2, diff, host)
|
||||||
copies = self.driver._helpers.lsvdiskcopy(vol1.name)
|
copies = self.driver._helpers.lsvdiskcopy(vol1.name)
|
||||||
self.assertEqual(2, len(copies))
|
self.assertEqual(2, len(copies))
|
||||||
|
get_vol_io_grp.assert_called_once_with(vol1.name)
|
||||||
self.driver.delete_volume(vol1)
|
self.driver.delete_volume(vol1)
|
||||||
|
|
||||||
def test_storwize_svc_retype_global_mirror_volume_to_none(self):
|
def test_storwize_svc_retype_global_mirror_volume_to_none(self):
|
||||||
|
@ -5142,7 +5142,7 @@ class StorwizeSVCCommonDriver(san.SanDriver,
|
|||||||
|
|
||||||
def _verify_retype_params(self, volume, new_opts, old_opts, need_copy,
|
def _verify_retype_params(self, volume, new_opts, old_opts, need_copy,
|
||||||
change_mirror, new_rep_type, old_rep_type,
|
change_mirror, new_rep_type, old_rep_type,
|
||||||
vdisk_changes, old_pool, new_pool):
|
vdisk_changes, old_pool, new_pool, old_io_grp):
|
||||||
# Some volume parameters can not be changed or changed at the same
|
# Some volume parameters can not be changed or changed at the same
|
||||||
# time during volume retype operation. This function checks the
|
# time during volume retype operation. This function checks the
|
||||||
# retype parameters.
|
# retype parameters.
|
||||||
@ -5195,7 +5195,6 @@ class StorwizeSVCCommonDriver(san.SanDriver,
|
|||||||
need_check_dr_pool_param = True
|
need_check_dr_pool_param = True
|
||||||
|
|
||||||
if new_rep_type != old_rep_type:
|
if new_rep_type != old_rep_type:
|
||||||
old_io_grp = self._helpers.get_volume_io_group(volume.name)
|
|
||||||
if (old_io_grp not in
|
if (old_io_grp not in
|
||||||
StorwizeHelpers._get_valid_requested_io_groups(
|
StorwizeHelpers._get_valid_requested_io_groups(
|
||||||
self._state, new_opts)):
|
self._state, new_opts)):
|
||||||
@ -5401,10 +5400,10 @@ class StorwizeSVCCommonDriver(san.SanDriver,
|
|||||||
old_io_grp = self._helpers.get_volume_io_group(volume['name'])
|
old_io_grp = self._helpers.get_volume_io_group(volume['name'])
|
||||||
new_io_grp = self._helpers.select_io_group(self._state,
|
new_io_grp = self._helpers.select_io_group(self._state,
|
||||||
new_opts, new_pool)
|
new_opts, new_pool)
|
||||||
|
|
||||||
self._verify_retype_params(volume, new_opts, old_opts, need_copy,
|
self._verify_retype_params(volume, new_opts, old_opts, need_copy,
|
||||||
change_mirror, new_rep_type, old_rep_type,
|
change_mirror, new_rep_type, old_rep_type,
|
||||||
vdisk_changes, old_pool, new_pool)
|
vdisk_changes, old_pool, new_pool,
|
||||||
|
old_io_grp)
|
||||||
|
|
||||||
if old_opts['volume_topology'] or new_opts['volume_topology']:
|
if old_opts['volume_topology'] or new_opts['volume_topology']:
|
||||||
self._check_hyperswap_retype_params(volume, new_opts, old_opts,
|
self._check_hyperswap_retype_params(volume, new_opts, old_opts,
|
||||||
|
7
releasenotes/notes/bug-1951250-storwize-fix-multiple-ssh-calls-for-retype-d3b56379b7d8b049.yaml
Normal file
7
releasenotes/notes/bug-1951250-storwize-fix-multiple-ssh-calls-for-retype-d3b56379b7d8b049.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
IBM Spectrum Virtualize Family driver
|
||||||
|
`Bug #1920870 <https://bugs.launchpad.net/cinder/+bug/1951250>`_:
|
||||||
|
Reduce multiple lsiogrp, lsvdisk calls in Retype operaton
|
||||||
|
to optimize the code.
|
Loading…
x
Reference in New Issue
Block a user