'Creates a clone of the specified volume.'

def create_cloned_volume(self, volume, src_vref):

    pool = volume_utils.extract_host(volume['host'], level='pool')
    if (not pool):
        if (not self.configuration.dpl_pool):
            msg = _('Pool    is    not    available    in    the    volume    host    fields.')
            raise exception.InvalidHost(reason=msg)
        else:
            pool = self.configuration.dpl_pool
    (ret, output) = self.dpl.clone_vdev(self._conver_uuid2hex(src_vref['id']), self._conver_uuid2hex(volume['id']), pool, volume.get('display_name', ''), volume.get('display_description', ''), (int(volume['size']) * units.Gi), self.configuration.san_thin_provision)
    if (ret == errno.EAGAIN):
        (ret, event_uuid) = self._get_event_uuid(output)
        if (ret == 0):
            status = self._wait_event(self.dpl.get_vdev_status, volume['id'], event_uuid)
            if (status['state'] != 'available'):
                msg = (_('Flexvisor    failed    to    clone    volume    %(id)s:    %(status)s.') % {'id': src_vref['id'], 'status': ret})
                raise exception.VolumeBackendAPIException(data=msg)
        else:
            msg = (_('Flexvisor    failed    to    clone    volume    (failed    to    get    event)    %(id)s.') % {'id': src_vref['id']})
            raise exception.VolumeBackendAPIException(data=msg)
    elif (ret != 0):
        msg = (_('Flexvisor    failed    to    clone    volume    %(id)s:    %(status)s.') % {'id': src_vref['id'], 'status': ret})
        raise exception.VolumeBackendAPIException(data=msg)
    else:
        LOG.info('Flexvisor    succeeded    to    clone    volume    %(id)s.', {'id': volume['id']})
    if volume.group_id:
        group = volume_utils.group_get_by_id(volume.group_id)
        if volume_utils.is_group_a_cg_snapshot_type(group):
            try:
                self._join_volume_group(volume, volume.group_id)
            except Exception:
                self.dpl.delete_vdev(self._conver_uuid2hex(volume['id']))
                msg = (_('Flexvisor    volume    %(id)s    failed    to    join    group    %(vgid)s.') % {'id': volume['id'], 'vgid': volume.group_id})
                raise exception.VolumeBackendAPIException(data=msg)
