'Creates a volume from a snapshot.'

def create_volume_from_snapshot(self, volume, snapshot):

    LOG.debug('create_volume_from_snapshot,    volume    id:    %(vid)s,    volume    size:    %(vsize)s,    snapshot    id:    %(sid)s.', {'vid': volume['id'], 'vsize': volume['size'], 'sid': snapshot['id']})
    self.conn = self._get_eternus_connection()
    source_volume_instance = self._find_lun(snapshot)
    if (source_volume_instance is None):
        msg = _('create_volume_from_snapshot,    Source    Volume    does    not    exist    in    ETERNUS.')
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    (element_path, metadata) = self.create_volume(volume)
    target_volume_instancename = self._create_eternus_instance_name(element_path['classname'], element_path['keybindings'])
    try:
        target_volume_instance = self._get_eternus_instance(target_volume_instancename)
    except Exception:
        msg = (_('create_volume_from_snapshot,    target    volume    instancename:    %(volume_instancename)s,    Get    Instance    Failed.') % {'volume_instancename': target_volume_instancename})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    self._create_local_cloned_volume(target_volume_instance, source_volume_instance)
    return (element_path, metadata)
