Coder Social home page Coder Social logo

fabian-z / virt-rbd-backup Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 1.35 MB

virt-rbd-backup makes automatic backups of virtual machines that are managed with libvirt (Hypervisor QEMU) and stored using Ceph RBD images.

License: Apache License 2.0

Python 100.00%
rbd libvirt virtual-machines python restic

virt-rbd-backup's Introduction

virt-rbd-backup

CodeFactor

virt-rbd-backup makes automatic backups of virtual machines that are managed with libvirt (Hypervisor QEMU) and stored using Ceph RBD images.

Python APIs from libvirt and Ceph are used to list the relevant virtual machines, create a coordinated RBD snapshot and save the snapshot to an output module. The snapshot is removed afterwards.

Developed and tested with Python v3.9.

Project scope

  • Dynamic list of relevant libvirt virtual machines
  • Create / Process / Delete RBD snapshots
  • Support multiple RBD images per VM
  • Output modules for external applications or backup targets (e.g. restic backup)
  • If supported by guest operating system: Pause FS activity during snapshot (using libvirt API and QEMU guest agent)

Out of scope

  • Implementation of backup management
  • Scheduling / Automation (external via systemd timer or cron)
  • Ceph cluster configuration or management

Architecture

Architecture diagram

References

libvirt Python development guide

RBD Python API reference

Dependencies

Both libvirt and rbd / rados Python packages should be installed with the packages providing your libvirt / Ceph distribution in order to achieve compatibility with the running virtualization and storage cluster.

It is currently assumed that the basic cluster configuration (at least mon_host and fsid) is setup in the default Ceph config file /etc/ceph/ceph.conf.

The (currently only) output module restic expects the restic executable in the search path.

Usage

Clone the repository, rename config.py.exampleto config.py and adjust the values to your needs. Execute main.py for automated backups. Currently, only restic output module is supported and the configured output repository must already be initialized. The repository password is expected as a keyfile.

Contributions

Contributions welcome - feel free to fork, experiment and open an issue and / or pull request.

License

Apache License 2.0, see LICENSE

virt-rbd-backup's People

Contributors

fabian-z avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

carltonxu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.