'Create a clone of the specified volume.'

def create_cloned_volume(self, volume, src_vref):

    LOG.debug('Creating    clone    of    volume:    %s.', src_vref['id'])
    name = (self.configuration.disco_volume_name_prefix, volume['id'])
    vol_name = ''.join(name)
    vol_size = (volume['size'] * units.Ki)
    src_vol_id = src_vref['provider_location']
    LOG.debug('Clone    volume    :    [name]    %(name)s    -    [source]    %(source)s    -    [size]    %(size)s.', {'name': vol_name, 'source': src_vol_id, 'size': six.text_type(vol_size)})
    reply = self.client.volumeClone(src_vol_id, vol_name)
    status = reply['status']
    result = reply['result']
    LOG.debug('Clone    volume    :    [status]    %(stat)s    -    [result]    %(res)s.', {'stat': six.text_type(status), 'res': result})
    if status:
        msg = (_('Error    while    creating    volume    [status]    %(stat)s    -    [result]    %(res)s.') % {'stat': six.text_type(status), 'res': result})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    params = {'clone_id': int(result), 'vol_name': vol_name}
    start_time = int(time.time())
    clone_request = DISCOCheck(self.client, params, start_time, 'clone_detail', self.configuration)
    clone_request._monitor_request(self.configuration.disco_clone_check_timeout)
    reply = self.client.volumeDetailByName(vol_name)
    status = reply['status']
    new_vol_id = reply['volumeInfoResult']['volumeId']
    if status:
        msg = (_('Error[%(stat)s    -    %(res)s]    while    getting    volume    id.'), {'stat': six.text_type(status), 'res': result})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    LOG.debug('clone    done    :    [status]    %(stat)s    -    [volume    id]    %(vol_id)s.', {'stat': status, 'vol_id': six.text_type(new_vol_id)})
    return {'provider_location': new_vol_id}
