All Projects → aruhier → virt-backup

aruhier / virt-backup

Licence: other
Backup your kvm guests managed by libvirt

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to virt-backup

virtnbdbackup
Backup utiliy for Libvirt / qemu / kvm supporting incremental and differencial backups.
Stars: ✭ 62 (-29.55%)
Mutual labels:  backup, libvirt
ansible-backup
Ansible daily backup role
Stars: ✭ 25 (-71.59%)
Mutual labels:  backup
virt-backup
Fully backup your KVM Virtual Machines
Stars: ✭ 27 (-69.32%)
Mutual labels:  backup
proxmox toolbox
A toolbox to get the firsts configurations of Proxmox VE / BS done in no time
Stars: ✭ 158 (+79.55%)
Mutual labels:  backup
myaas
Fresh Mysql instances for your developers in seconds
Stars: ✭ 26 (-70.45%)
Mutual labels:  backup
open2fa
Two-factor authentication app with import/export for iOS and macOS. All codes encrypted with AES 256. FaceID & TouchID support included. Written with love in SwiftUI ❤️
Stars: ✭ 24 (-72.73%)
Mutual labels:  backup
piratcloud
an ipfs-based encrypted backup solution
Stars: ✭ 20 (-77.27%)
Mutual labels:  backup
jira-backup-py
python script to create, download and upload to s3 your Jira or Confluence cloud instance backup
Stars: ✭ 36 (-59.09%)
Mutual labels:  backup
b2-sdk-php
SDK for Backblaze's B2 storage service.
Stars: ✭ 75 (-14.77%)
Mutual labels:  backup
IAmLazy
Easily backup and restore your tweaks
Stars: ✭ 37 (-57.95%)
Mutual labels:  backup
VestaCP-Sync-Backups-To-Mega
VestaCP: uploading backups to the MEGA cloud
Stars: ✭ 17 (-80.68%)
Mutual labels:  backup
vbo365-rest-self-service
Unofficial Self-Service Web Portal for Veeam Backup for Microsoft Office 365
Stars: ✭ 24 (-72.73%)
Mutual labels:  backup
kubic-terraform-kvm
Kubic Terraform script using KVM/libvirt
Stars: ✭ 30 (-65.91%)
Mutual labels:  libvirt
sicksync
Don’t accept the available as the preferable. Go the extra mile with extra speed.
Stars: ✭ 67 (-23.86%)
Mutual labels:  backup
underbase
MongoDB schema and data migration library based on semver
Stars: ✭ 19 (-78.41%)
Mutual labels:  backup
OBS Settings Manager
Backup your OBS Studio profiles and manage them in an easy, user friendly way.
Stars: ✭ 20 (-77.27%)
Mutual labels:  backup
butdr
Backup to Cloud( Google Drive, Dropbox ... ) use rclone
Stars: ✭ 49 (-44.32%)
Mutual labels:  backup
evcloud
EVCloud是一个基于ceph和libvirt的轻量级云主机管理平台,实用稳定,维护简易
Stars: ✭ 44 (-50%)
Mutual labels:  libvirt
extract-xiso
Xbox ISO Creation/Extraction utility. Imported from SourceForge.
Stars: ✭ 358 (+306.82%)
Mutual labels:  backup
goodrexport
Goodreads data export
Stars: ✭ 16 (-81.82%)
Mutual labels:  backup

virt-backup

Build Status Coverage Status

Do external backup of your KVM guests, managed by libvirt, using the BlockCommit feature. The main goal is to do a modest alternative to the Proxmox VE backup system (without their vma system) to automatically backup your disks (with optional compression) and easily restore ones. Guests are configured by groups, and can be matched via regex.

Documentation

Documentation is available here.

Installation

Run:

pip3 install virt-backup

If you are running on ArchLinux, virt-backup is available through the AUR package virt-backup. virt-backup is tested under Python 3.5 and 3.6, 3.7. Python < 3.5 is not supported anymore, due to some deprecations in the used libraries.

virt-backup should have access to every disk image desired to be backup. It should also be able to run qemu-img (normally installed with libvirt), as it is used to backup inactive domains.

Configuration

The configuration file is looked up into the following paths, in this specific order: ~/.config/virt-backup/config.yml, /etc/virt-backup/config.yml, and, if you cloned this repository, in the project's root.

A self-documented example is available in example/config.yml.

Usage

Run the application by calling virt-backup:

$ virt-backup -h
usage: virt-backup [-h] [-d] [--version]
                   {backup,bak,restore,clean,cl,list,ls} ...

Backup and restore your kvm libvirt domains

positional arguments:
  {backup,bak,restore,clean,cl,list,ls}
    backup (bak)        backup groups
    restore             restore backup
    clean (cl)          clean groups
    list (ls)           list groups

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           set the debug level
  --version             show program's version number and exit

Backup

Subcommand allowing to start the backup for all (except those with the autostart option disabled) or only the specified groups.

$ virt-backup backup -h
usage: virt-backup backup [-h] [group [group ...]]

positional arguments:
  group       domain group to backup

For each domain matching a group, the following process is followed:

  1. An external snapshot is created for all disks concerned by the backup, in order to freeze the images. For the same domain, all snapshots are created are the same time, so there is no inconsistency between disks.
  2. A temporary file is created in the backup directory, containing all info to revert the backup if virt-backup crashed during the process (resulting in a broken backup and external snapshots that have not been removed). These backups can be cleaned by using the clean subcommand.
  3. Images are copied.
  4. BlockCommit is used to merge temporary external snapshots with their base disk, and to pivot to the original disk. If the domain is inactive, libvirt cannot achieve this step, so qemu-img is used.
  5. Remove all temporary file.

List

List a short summary of multiple or all groups. If a domain name is specified, it will list all its backups, sorted by date.

$ virt-backup list -h
usage: virt-backup list [-h] [-D domain_name] [-s] [group [group ...]]

positional arguments:
  group                 domain group to list

optional arguments:
  -D domain_name, --domain domain_name
                        show list of backups for specific domain
  -a, --all             show all domains matching, even without backup
  -s, --short           short version, do not print details

By default, only domains with at least one backup will be listed, but all domains matching with the group rules can be printed by using the -a/--all option.

Restore

Restore a backup. If no date is specified, it will restore the last backup found for the specified group and domain.

$ virt-backup restore -h
usage: virt-backup restore [-h] [--date date] group domain target_dir

positional arguments:
  group        domain group
  domain       domain name
  target_dir   destination path

optional arguments:
  --date date  backup date (default: last backup)

Clean

Clean complete backups, depending on the retention policy (as defined for each group in the configuration), and broken backups.

A systemd service is available in example/virt-backup-clean.service to trigger a cleaning of all broken backups at start. This way, if the hypervisor crashed during a backup, the service will clean all temporary files and pivot all disks on their original images (instead of running on a temporary external snapshot).

$ virt-backup clean -h
usage: virt-backup clean [-h] [-b | -B] [group [group ...]]

positional arguments:
  group              domain group to clean

optional arguments:
  -b, --broken-only  only clean broken backups
  -B, --no-broken    do not clean broken backups

License

Tool under the BSD license. Do not hesitate to report bugs, ask me some questions or do some pull request if you want to!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].