'Creates a volume from a snapshot.'

def create_volume_from_snapshot(self, volume, snapshot):

    LOG.debug('Creating    volume    from    snapshot:    %s', snapshot['name'])
    volume_name = (self.configuration.zadara_vol_name_template % snapshot['volume_name'])
    cg_name = self._get_volume_cg_name(volume_name)
    if (not cg_name):
        LOG.error('Volume    %(name)s    not    found', {'name': volume_name})
        raise exception.VolumeNotFound(volume_id=volume['id'])
    snap_id = self._get_snap_id(cg_name, snapshot['name'])
    if (not snap_id):
        LOG.error('Snapshot    %(name)s    not    found', {'name': snapshot['name']})
        raise exception.SnapshotNotFound(snapshot_id=snapshot['id'])
    self.vpsa.send_cmd('create_clone_from_snap', cg_name=cg_name, name=(self.configuration.zadara_vol_name_template % volume['name']), snap_id=snap_id)
    if (volume['size'] > snapshot['volume_size']):
        self.extend_volume(volume, volume['size'])
