'Create a clone of an existing volume or snapshot.'

def _do_clone_volume(self, src_uuid, vref, sf_src_snap=None):

    attributes = {}
    sf_account = self._get_create_account(vref['project_id'])
    params = {'name': ('%(prefix)s%(id)s' % {'prefix': self.configuration.sf_volume_prefix, 'id': vref['id']}), 'newAccountID': sf_account['accountID']}
    is_clone = False
    sf_vol = None
    if sf_src_snap:
        params['snapshotID'] = sf_src_snap['snapshotID']
        params['volumeID'] = sf_src_snap['volumeID']
        params['newSize'] = int((vref['size'] * units.Gi))
    else:
        (params, is_clone, sf_vol) = self._snapshot_discovery(src_uuid, params, vref)
    data = self._issue_api_request('CloneVolume', params, version='6.0')
    if (('result' not in data) or ('volumeID' not in data['result'])):
        msg = (_('API    response:    %s') % data)
        raise exception.SolidFireAPIException(msg)
    sf_volume_id = data['result']['volumeID']
    qos = self._retrieve_qos_setting(vref)
    params = {'volumeID': sf_volume_id}
    if qos:
        params['qos'] = qos
    create_time = vref['created_at'].isoformat()
    attributes = {'uuid': vref['id'], 'is_clone': 'True', 'src_uuid': src_uuid, 'created_at': create_time}
    params['attributes'] = attributes
    data = self._issue_api_request('ModifyVolume', params)
    model_update = self._get_model_info(sf_account, sf_volume_id)
    if (model_update is None):
        mesg = _('Failed    to    get    model    update    from    clone')
        raise exception.SolidFireAPIException(mesg)
    if is_clone:
        data = self._update_attributes(sf_vol)
    return (data, sf_account, model_update)
