'Creates a volume from snapshot.'

def create_volume_from_snapshot(self, volume, snapshot):

    vol_size = volume.size
    snap_size = snapshot.volume_size
    self._clone_snapshot(snapshot.provider_id, volume.name, snapshot.volume_id)
    share = self._get_provider_location(snapshot.volume_id)
    volume['provider_location'] = share
    path = self.local_path(volume)
    self._set_rw_permissions(path)
    if (vol_size != snap_size):
        try:
            self.extend_volume(volume, vol_size)
        except Exception:
            LOG.error('Resizing    %s    failed.    Cleaning    volume.', volume.name)
            self._delete_file(path)
            raise
    return {'provider_location': volume['provider_location']}
