When cloning a volume with SolidFire driver, the owner of
the cloned volume is not set correctly in SolidFire when there is
a transfer of ownership.
This results in inconsistent states where the cloned volume
is owned by the new tenant in Cinder but SolidFire thinks it is still
owned by the original volume's tenant.
This patch adds the newAccountID parameter to all CloneVolume calls.
If the cloned volume is owned by the same tenant, newAccountID will
be set to the same value as the original SolidFire volume. There
will be no change of ownership done by the cloning process in SolidFire.
If the cloned volume should be owned by a different tenant, newAccountID
will be set to the appropriate SolidFire account corresponding
to the new tenant. If the SolidFire account does not exist already,
it will be created.
Fixes: bug #1183521
Change-Id: I622ca2962478298e3e0c5a26866e39919805075f
(cherry picked from commit
af023fe0cce3b8ef2b90ec37f1bc49feb17eac83)
if sf_vol is None:
raise exception.VolumeNotFound(volume_id=uuid)
+ if src_project_id != v_ref['project_id']:
+ sfaccount = self._create_sfaccount(v_ref['project_id'])
+
if 'qos' in sf_vol:
qos = sf_vol['qos']
params = {'volumeID': int(sf_vol['volumeID']),
'name': 'UUID-%s' % v_ref['id'],
'attributes': attributes,
+ 'newAccountID': sfaccount['accountID'],
'qos': qos}
data = self._issue_api_request('CloneVolume', params)