'Restore volume from backup in Ceph object store.
If volume metadata is available this will also be restored.'

def restore(self, backup, volume_id, volume_file):

    target_volume = self.db.volume_get(self.context, volume_id)
    LOG.debug('Starting    restore    from    Ceph    backup=%(src)s    to    volume=%(dest)s', {'src': backup.id, 'dest': target_volume.name})
    try:
        self._restore_volume(backup, target_volume, volume_file)
        try:
            fileno = volume_file.fileno()
        except IOError:
            LOG.debug('Restore    target    I/O    object    does    not    support    fileno()    -    skipping    call    to    fsync().')
        else:
            os.fsync(fileno)
        self._restore_metadata(backup, volume_id)
        LOG.debug('Restore    to    volume    %s    finished    successfully.', volume_id)
    except exception.BackupOperationError as e:
        LOG.error('Restore    to    volume    %(volume)s    finished    with    error    -    %(error)s.', {'error': e, 'volume': volume_id})
        raise
