'Creates volume from given snapshot ( snapshot clone to volume ).'

@retry_wrapper
def create_volume_from_snapshot(self, snapshot, volume, truncate_name=False):

    self.authenticate_user()
    if self.configuration.coprhd_emulate_snapshot:
        self.create_cloned_volume(volume, snapshot, truncate_name)
        return
    try:
        if snapshot.group_snapshot_id:
            raise coprhd_utils.CoprHdError(coprhd_utils.CoprHdError.SOS_FAILURE_ERR, _('Volume    cannot    be    created    individually    from    a    snapshot    that    is    part    of    a    Consistency    Group'))
    except AttributeError:
        pass
    src_snapshot_name = None
    src_vol_ref = snapshot.volume
    new_volume_name = self._get_resource_name(volume, MAX_DEFAULT_NAME_LENGTH, truncate_name)
    try:
        coprhd_vol_info = self._get_coprhd_volume_name(src_vol_ref, True)
        src_snapshot_name = self._get_coprhd_snapshot_name(snapshot, coprhd_vol_info['volume_uri'])
        (storageres_type, storageres_typename) = self.volume_obj.get_storageAttributes(coprhd_vol_info['volume_name'], None, src_snapshot_name)
        resource_id = self.volume_obj.storage_resource_query(storageres_type, coprhd_vol_info['volume_name'], None, src_snapshot_name, self.configuration.coprhd_project, self.configuration.coprhd_tenant)
        self.volume_obj.clone(new_volume_name, resource_id, sync=True)
    except coprhd_utils.CoprHdError as e:
        coprhd_err_msg = (_('Snapshot    %(src_snapshot_name)s:    clone    failed\n%(err)s') % {'src_snapshot_name': src_snapshot_name, 'err': six.text_type(e.msg)})
        log_err_msg = ('Snapshot    :    %s    clone    failed' % src_snapshot_name)
        self._raise_or_log_exception(e.err_code, coprhd_err_msg, log_err_msg)
    if (volume.size > snapshot.volume_size):
        size_in_bytes = coprhd_utils.to_bytes(('%sG' % volume.size))
        try:
            self.volume_obj.expand(('%s/%s' % (self.configuration.coprhd_tenant, self.configuration.coprhd_project)), new_volume_name, size_in_bytes, True)
        except coprhd_utils.CoprHdError as e:
            coprhd_err_msg = (_('Volume    %(volume_name)s:    expand    failed\n%(err)s') % {'volume_name': new_volume_name, 'err': six.text_type(e.msg)})
            log_err_msg = ('Volume    :    %s    expand    failed' % new_volume_name)
            self._raise_or_log_exception(e.err_code, coprhd_err_msg, log_err_msg)
