'Creates a clone of the specified volume.'

def create_cloned_volume(self, volume, src_vref):

    if (self.configuration.lvm_type == 'thin'):
        self.vg.create_lv_snapshot(volume['name'], src_vref['name'], self.configuration.lvm_type)
        if (volume['size'] > src_vref['size']):
            LOG.debug('Resize    the    new    volume    to    %s.', volume['size'])
            self.extend_volume(volume, volume['size'])
        self.vg.activate_lv(volume['name'], is_snapshot=True, permanent=True)
        return
    mirror_count = 0
    if self.configuration.lvm_mirrors:
        mirror_count = self.configuration.lvm_mirrors
    LOG.info('Creating    clone    of    volume:    %s', src_vref['id'])
    volume_name = src_vref['name']
    temp_id = ('tmp-snap-%s' % volume['id'])
    temp_snapshot = {'volume_name': volume_name, 'size': src_vref['size'], 'volume_size': src_vref['size'], 'name': ('clone-snap-%s' % volume['id']), 'id': temp_id}
    self.create_snapshot(temp_snapshot)
    try:
        self._create_volume(volume['name'], self._sizestr(volume['size']), self.configuration.lvm_type, mirror_count)
        self.vg.activate_lv(temp_snapshot['name'], is_snapshot=True)
        volutils.copy_volume(self.local_path(temp_snapshot), self.local_path(volume), (src_vref['size'] * units.Ki), self.configuration.volume_dd_blocksize, execute=self._execute, sparse=self._sparse_copy_volume)
    finally:
        self.delete_snapshot(temp_snapshot)
