3PAR: Inconsistency in copied and source CG
1. While creating a consistency group from a source consistency group having thinly provisioned volume(s), the target volumes would not be thinly provisioned because 'tpvv' parameter was not being passed. Same thing was happening for thinly deduplicated volume(s). Extracted the optional boolean parameters 'tpvv' and 'tdvv', if present , from the source volume(s) to be used for corresponding target volume(s) creation. In case these are not present, default value of False is used. Fixed the test case too so that it could accept these addtional two parameters. 2. Cloning a CG with a bootable volume would create a CG with a non-bootable volume. This was due to 'bootable' flag of source volume not being used while creating DB entry for target volume. Closes-Bug: #1655541 Change-Id: Ia997629a3b2189d1722f87edda5f3989fe79ffdb
This commit is contained in:
parent
c5856fe03e
commit
5c7323082e
@ -3889,7 +3889,8 @@ class HPE3PARBaseDriver(object):
|
||||
mock.ANY,
|
||||
self.VOLUME_NAME_3PAR,
|
||||
HPE3PAR_CPG,
|
||||
{'snapCPG': HPE3PAR_CPG, 'online': True}),
|
||||
{'snapCPG': HPE3PAR_CPG, 'online': True,
|
||||
'tpvv': mock.ANY, 'tdvv': mock.ANY}),
|
||||
mock.call.addVolumeToVolumeSet(
|
||||
self.CONSIS_GROUP_NAME,
|
||||
self.VOLUME_NAME_3PAR)]
|
||||
|
@ -562,7 +562,10 @@ class HPE3PARCommon(object):
|
||||
volume_name = self._get_3par_vol_name(volume['id'])
|
||||
type_info = self.get_volume_settings_from_type(volume)
|
||||
cpg = type_info['cpg']
|
||||
optional = {'online': True, 'snapCPG': cpg}
|
||||
tpvv = type_info.get('tpvv', False)
|
||||
tdvv = type_info.get('tdvv', False)
|
||||
optional = {'online': True, 'snapCPG': cpg,
|
||||
'tpvv': tpvv, 'tdvv': tdvv}
|
||||
self.client.copyVolume(snap_name, volume_name, cpg, optional)
|
||||
self.client.addVolumeToVolumeSet(vvs_name, volume_name)
|
||||
|
||||
|
@ -518,6 +518,14 @@ class EntryCreateTask(flow_utils.CinderTask):
|
||||
pre-cursor task.
|
||||
"""
|
||||
|
||||
src_volid = kwargs.get('source_volid')
|
||||
src_vol = None
|
||||
if src_volid is not None:
|
||||
src_vol = objects.Volume.get_by_id(context, src_volid)
|
||||
bootable = False
|
||||
if src_vol is not None:
|
||||
bootable = src_vol.bootable
|
||||
|
||||
volume_properties = {
|
||||
'size': kwargs.pop('size'),
|
||||
'user_id': context.user_id,
|
||||
@ -529,6 +537,7 @@ class EntryCreateTask(flow_utils.CinderTask):
|
||||
'display_description': kwargs.pop('description'),
|
||||
'display_name': kwargs.pop('name'),
|
||||
'multiattach': kwargs.pop('multiattach'),
|
||||
'bootable': bootable,
|
||||
}
|
||||
|
||||
# Merge in the other required arguments which should provide the rest
|
||||
|
Loading…
Reference in New Issue
Block a user