Merge "[SVf]:Fix retype failure for replication volume-type"
This commit is contained in:
commit
0eef543691
@ -1577,6 +1577,7 @@ port_speed!N/A
|
|||||||
source = ''
|
source = ''
|
||||||
target = ''
|
target = ''
|
||||||
copyrate = kwargs['copyrate'] if 'copyrate' in kwargs else '50'
|
copyrate = kwargs['copyrate'] if 'copyrate' in kwargs else '50'
|
||||||
|
cleanrate = kwargs['cleanrate'] if 'clean_rate' in kwargs else '50'
|
||||||
|
|
||||||
if 'source' not in kwargs:
|
if 'source' not in kwargs:
|
||||||
return self._errors['CMMVC5707E']
|
return self._errors['CMMVC5707E']
|
||||||
@ -1603,6 +1604,7 @@ port_speed!N/A
|
|||||||
fcmap_info['id'] = self._find_unused_id(self._fcmappings_list)
|
fcmap_info['id'] = self._find_unused_id(self._fcmappings_list)
|
||||||
fcmap_info['name'] = 'fcmap' + fcmap_info['id']
|
fcmap_info['name'] = 'fcmap' + fcmap_info['id']
|
||||||
fcmap_info['copyrate'] = copyrate
|
fcmap_info['copyrate'] = copyrate
|
||||||
|
fcmap_info['cleanrate'] = cleanrate
|
||||||
fcmap_info['progress'] = '0'
|
fcmap_info['progress'] = '0'
|
||||||
fcmap_info['autodelete'] = True if 'autodelete' in kwargs else False
|
fcmap_info['autodelete'] = True if 'autodelete' in kwargs else False
|
||||||
fcmap_info['status'] = 'idle_or_copied'
|
fcmap_info['status'] = 'idle_or_copied'
|
||||||
@ -1727,7 +1729,7 @@ port_speed!N/A
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return self._errors['CMMVC5753E']
|
return self._errors['CMMVC5753E']
|
||||||
|
|
||||||
for key in ['name', 'copyrate', 'autodelete']:
|
for key in ['name', 'copyrate', 'cleanrate', 'autodelete']:
|
||||||
if key in kwargs:
|
if key in kwargs:
|
||||||
fcmap[key] = kwargs[key]
|
fcmap[key] = kwargs[key]
|
||||||
return ('', '')
|
return ('', '')
|
||||||
@ -5566,7 +5568,7 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
|
|||||||
if self.USESIM:
|
if self.USESIM:
|
||||||
# validate copyrate was set on the flash copy
|
# validate copyrate was set on the flash copy
|
||||||
for i, fcmap in self.sim._fcmappings_list.items():
|
for i, fcmap in self.sim._fcmappings_list.items():
|
||||||
if fcmap['target'] == vol1['name']:
|
if fcmap['target'] == vol2['name']:
|
||||||
self.assertEqual('49', fcmap['copyrate'])
|
self.assertEqual('49', fcmap['copyrate'])
|
||||||
self._assert_vol_exists(vol2['name'], True)
|
self._assert_vol_exists(vol2['name'], True)
|
||||||
|
|
||||||
@ -5578,7 +5580,7 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
|
|||||||
if self.USESIM:
|
if self.USESIM:
|
||||||
# Validate copyrate was set on the flash copy
|
# Validate copyrate was set on the flash copy
|
||||||
for i, fcmap in self.sim._fcmappings_list.items():
|
for i, fcmap in self.sim._fcmappings_list.items():
|
||||||
if fcmap['target'] == vol1['name']:
|
if fcmap['target'] == vol3['name']:
|
||||||
self.assertEqual('49', fcmap['copyrate'])
|
self.assertEqual('49', fcmap['copyrate'])
|
||||||
self._assert_vol_exists(vol3['name'], True)
|
self._assert_vol_exists(vol3['name'], True)
|
||||||
|
|
||||||
@ -5589,7 +5591,7 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
|
|||||||
if self.USESIM:
|
if self.USESIM:
|
||||||
# Validate copyrate was set on the flash copy
|
# Validate copyrate was set on the flash copy
|
||||||
for i, fcmap in self.sim._fcmappings_list.items():
|
for i, fcmap in self.sim._fcmappings_list.items():
|
||||||
if fcmap['target'] == vol1['name']:
|
if fcmap['target'] == vol4['name']:
|
||||||
self.assertEqual('50', fcmap['cleanrate'])
|
self.assertEqual('50', fcmap['cleanrate'])
|
||||||
self._assert_vol_exists(vol4['name'], True)
|
self._assert_vol_exists(vol4['name'], True)
|
||||||
|
|
||||||
@ -5628,13 +5630,13 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
|
|||||||
if self.USESIM:
|
if self.USESIM:
|
||||||
# Validate copyrate was set on the flash copy
|
# Validate copyrate was set on the flash copy
|
||||||
for i, fcmap in self.sim._fcmappings_list.items():
|
for i, fcmap in self.sim._fcmappings_list.items():
|
||||||
if fcmap['target'] == vol1['name']:
|
if fcmap['target'] == volume2['name']:
|
||||||
self.assertEqual('49', fcmap['copyrate'])
|
self.assertEqual('49', fcmap['copyrate'])
|
||||||
self.driver.retype(ctxt, volume, new_type, diff, host)
|
self.driver.retype(ctxt, volume, new_type, diff, host)
|
||||||
if self.USESIM:
|
if self.USESIM:
|
||||||
# Validate copyrate was set on the flash copy
|
# Validate copyrate was set on the flash copy
|
||||||
for i, fcmap in self.sim._fcmappings_list.items():
|
for i, fcmap in self.sim._fcmappings_list.items():
|
||||||
if fcmap['target'] == vol1['name']:
|
if fcmap['source'] == volume['name']:
|
||||||
self.assertEqual('149', fcmap['copyrate'])
|
self.assertEqual('149', fcmap['copyrate'])
|
||||||
|
|
||||||
# create cloned volume with new type diffrent iogrp
|
# create cloned volume with new type diffrent iogrp
|
||||||
@ -5682,16 +5684,23 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
|
|||||||
volume2 = testutils.create_volume(
|
volume2 = testutils.create_volume(
|
||||||
self.ctxt,
|
self.ctxt,
|
||||||
volume_type_id=self.vt['id'])
|
volume_type_id=self.vt['id'])
|
||||||
self.driver.retype(ctxt, volume, new_type, diff, host)
|
|
||||||
if self.USESIM:
|
# Create the snapshot of the source volume
|
||||||
self.sim.error_injection('lsfcmap', 'speed_up')
|
snap = self._generate_snap_info(volume.id)
|
||||||
self.driver.create_cloned_volume(volume2, volume)
|
self.driver.create_snapshot(snap)
|
||||||
if self.USESIM:
|
if self.USESIM:
|
||||||
# Validate cleanrate was set on the flash copy
|
# Validate cleanrate was set on the flash copy
|
||||||
for i, fcmap in self.sim._fcmappings_list.items():
|
for i, fcmap in self.sim._fcmappings_list.items():
|
||||||
if fcmap['target'] == volume['name']:
|
if fcmap['source'] == volume['name']:
|
||||||
|
self.assertEqual('50', fcmap['cleanrate'])
|
||||||
|
|
||||||
|
# Try to retype the source volume
|
||||||
|
self.driver.retype(ctxt, volume, new_type, diff, host)
|
||||||
|
if self.USESIM:
|
||||||
|
# Validate cleanrate was set on the flash copy
|
||||||
|
for i, fcmap in self.sim._fcmappings_list.items():
|
||||||
|
if fcmap['source'] == volume['name']:
|
||||||
self.assertEqual('100', fcmap['cleanrate'])
|
self.assertEqual('100', fcmap['cleanrate'])
|
||||||
self._assert_vol_exists(volume2['name'], True)
|
|
||||||
|
|
||||||
# Delete the volumes
|
# Delete the volumes
|
||||||
self.driver.delete_volume(volume2)
|
self.driver.delete_volume(volume2)
|
||||||
|
@ -2280,8 +2280,11 @@ class StorwizeHelpers(object):
|
|||||||
def update_clean_rate(self, volume_name, new_clean_rate):
|
def update_clean_rate(self, volume_name, new_clean_rate):
|
||||||
mapping_ids = self._get_vdisk_fc_mappings(volume_name)
|
mapping_ids = self._get_vdisk_fc_mappings(volume_name)
|
||||||
for map_id in mapping_ids:
|
for map_id in mapping_ids:
|
||||||
|
attrs = self._get_flashcopy_mapping_attributes(map_id)
|
||||||
|
# chfcmap should not be called for rc_controlled fcmap
|
||||||
|
if attrs is not None and attrs['rc_controlled'] != 'yes':
|
||||||
self.ssh.chfcmap(map_id,
|
self.ssh.chfcmap(map_id,
|
||||||
clean_rate=six.text_type(new_clean_rate))
|
clean_rate=str(new_clean_rate))
|
||||||
|
|
||||||
def check_flashcopy_rate(self, flashcopy_rate):
|
def check_flashcopy_rate(self, flashcopy_rate):
|
||||||
if not self.code_level:
|
if not self.code_level:
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
IBM Spectrum Virtualize Family driver: `Bug #1968159
|
||||||
|
<https://bugs.launchpad.net/cinder/+bug/1968159>`_:
|
||||||
|
Fix for retype failure for replicated volume-type.
|
||||||
|
Controlling chfcmap call for rc_controlled fcmap
|
||||||
|
for replication-type volumes during retype operation.
|
Loading…
Reference in New Issue
Block a user