Merge "3PAR: Inconsistency in copied and source CG"

This commit is contained in:
Jenkins 2017-02-01 13:48:23 +00:00 committed by Gerrit Code Review
commit 8c186565c3
3 changed files with 15 additions and 2 deletions

View File

@ -4113,7 +4113,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)]

View File

@ -565,7 +565,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)

View File

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