Compare commits

..

9 Commits

Author SHA1 Message Date
5bc5cf3a99 Interactive mode / improved container persistence / updated SysAdmin notes 2023-03-07 20:12:44 -04:00
b67847b652 Fixed examples syntax 2023-03-07 20:05:55 -04:00
345f120b46 Fixed typo / updated references to source code README 2023-03-07 15:27:03 -04:00
Adrian
457a463f62
Version 1.1 2023-03-07 14:53:22 -04:00
Adrian
b9171b1ab8
Merge pull request #1 from abbbi/offline
virtnbdbackup now supports backup of offline domains, too
2023-03-07 12:26:05 -04:00
Adrian
905de502b1
Merge pull request #2 from abbbi/lxml
add python3-lxml to dependencies
2023-03-07 12:25:34 -04:00
Michael Ablassmeier
0f89ddf7ee add python3-paramiko, too 2022-07-27 16:51:27 +02:00
ma
498d36326e add python3-lxml to dependencies 2022-07-05 15:02:37 +02:00
ma
ae674246cf virtnbdbackup now supports backup of offline domains, too 2022-06-30 22:55:13 +02:00
2 changed files with 38 additions and 14 deletions

View File

@ -6,14 +6,14 @@ LABEL container.name="virtnbdbackup-docker"
LABEL container.source.description="Backup utiliy for Libvirt kvm / qemu with Incremental backup support via NBD" LABEL container.source.description="Backup utiliy for Libvirt kvm / qemu with Incremental backup support via NBD"
LABEL container.description="virtnbdbackup and virtnbdrestore (plus depedencies) to run on hosts with libvirt >= 6.0.0" LABEL container.description="virtnbdbackup and virtnbdrestore (plus depedencies) to run on hosts with libvirt >= 6.0.0"
LABEL container.source=$source LABEL container.source=$source
LABEL container.version="1.0" LABEL container.version="1.1"
LABEL maintainer="Adrián Parilli <a.parilli@staffwerke.de>" LABEL maintainer="Adrián Parilli <a.parilli@staffwerke.de>"
# Deploys dependencies and pulls sources, installing virtnbdbackup and removing unnecessary content: # Deploys dependencies and pulls sources, installing virtnbdbackup and removing unnecessary content:
RUN \ RUN \
apt-get update && \ apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
ca-certificates git python3-all python3-libnbd python3-libvirt python3-lz4 python3-setuptools python3-tqdm qemu-utils && \ ca-certificates git python3-all python3-libnbd python3-libvirt python3-lz4 python3-setuptools python3-tqdm qemu-utils python3-lxml python3-paramiko && \
git clone $source.git && \ git clone $source.git && \
cd virtnbdbackup && python3 setup.py install && cd .. && \ cd virtnbdbackup && python3 setup.py install && cd .. && \
apt-get purge -y git ca-certificates && apt-get -y autoremove --purge && apt-get clean && \ apt-get purge -y git ca-certificates && apt-get -y autoremove --purge && apt-get clean && \

View File

@ -14,7 +14,7 @@ It has been successfully tested on UnRaid v6.9.2, but should work the same on ma
## Requirements: ## Requirements:
- Docker Engine. See [Docker Documentation](https://docs.docker.com/get-docker/) for further instructions - Docker Engine. See [Docker Documentation](https://docs.docker.com/get-docker/) for further instructions
- libvirt >=6.0.0 - libvirt >=6.0.0
- To have performed the punctual modifications on VM's XML file and image format, as pointed at [source code's README](https://github.com/abbbi/virtnbdbackup), so this tool will work for you. - To have performed the punctual modifications on VM's XML file and image format, as pointed at source code [README](https://github.com/abbbi/virtnbdbackup/blob/master/README.md), so this tool will work for you.
Note: This image carries latest 'qemu-utils' as of its base OS for internal processing of images during restoration. Note: This image carries latest 'qemu-utils' as of its base OS for internal processing of images during restoration.
@ -43,7 +43,7 @@ Note: This image carries latest 'qemu-utils' as of its base OS for internal proc
`-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups \` `-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups \`
`docker-virtnbdbackup \` `adrianparilli/virtnbdbackup-docker \`
`virtnbdbackup -d <domain-name> -l full -o /mnt/backups/<domain-name>` `virtnbdbackup -d <domain-name> -l full -o /mnt/backups/<domain-name>`
@ -55,7 +55,7 @@ Note: This image carries latest 'qemu-utils' as of its base OS for internal proc
`-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups \` `-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups \`
`docker-virtnbdbackup \` `adrianparilli/virtnbdbackup-docker \`
`virtnbdbackup -d <domain-name> -l inc -o /mnt/backups/<domain-name>` `virtnbdbackup -d <domain-name> -l inc -o /mnt/backups/<domain-name>`
@ -67,33 +67,57 @@ Note: This image carries latest 'qemu-utils' as of its base OS for internal proc
`-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored \` `-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored \`
`docker-virtnbdbackup \` `adrianparilli/virtnbdbackup-docker \`
`virtnbdrestore -i /mnt/-backups/<domain-backup> -a restore -o /mnt/restored` `virtnbdrestore -i /mnt/backups/<domain-backup> -a restore -o /mnt/restored`
Where `/mnt/restored` is an example folder in your system, where virtnbdrestore will rebuild virtual disk(s) based on existing backups, with its internal block device name, such as 'sda', 'vda', 'hdc', etc. Where `/mnt/restored` is an example folder in your system, where virtnbdrestore will rebuild virtual disk(s) based on existing backups, with its internal block device name, such as 'sda', 'vda', 'hdc', etc.
### Persistent container: ### Interactive mode / debugging virtnbdbackup:
In the above examples, the container will be removed as soon the invoked command has been executed. This is the optimal behaviour when you intend to automatize operations (such as incremental backups.)
In addition, you can set a persistent container with all necessary bind mounts with: You can also run the container in interactive mode by running its build in shell, and then execute multiple backup/restoration commands, as needed. This also very is useful for debugging purposes:
`docker create --name <container-name>`
`docker run -rm -it \`
`-v /var/tmp:/var/tmp -v /run:/run -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored' \` `-v /var/tmp:/var/tmp -v /run:/run -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored' \`
`docker-virtnbdbackup \` `adrianparilli/virtnbdbackup-docker \`
`/bin/bash` `/bin/bash`
And attach to its Shell with: `docker start -i <container-name>` to perform manual backups/restorations or for debugging purposes. Exiting the Shell will stop it immediately.
and execute commands as desired. The container will keep running until you type `exit` on the internal shell.
### Persistent container:
In the above examples, the container will be removed as soon the invoked command has been executed. This is the optimal behaviour when you intend to automatize operations, such as incremental backups. In addition, you can set a persistent container with all necessary bind mounts with:
`docker create --name <container-name> \`
`-v /var/tmp:/var/tmp -v /run:/run -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored' \`
`adrianparilli/virtnbdbackup-docker \`
`/bin/bash`
Just creating a new container (with custom name) with mount points set and ready to run in interactive mode. To start it and automatically enter into the internal shell, just type:
`docker start -i <container-name>`
And again, stopping it with the command `exit` from its shell.
For more usage examples (including latest features) refer to source code [README](https://github.com/abbbi/virtnbdbackup/blob/master/README.md)
## Quick Notes for SysAdmins: ## Quick Notes for SysAdmins:
- Modifications on VM's XML files while domains are running, requires to restart such domains. - Modifications on VM's XML files while domains are running, requires to restart such domains.
- Backup jobs will be executed on running domains only.
- Restoration jobs are independent of domain's state (it can be running or not) but actual restoration of domain has to be done by hand, by: - Restoration jobs are independent of domain's state (it can be running or not) but actual restoration of domain has to be done by hand, by:
- Stopping the domain - Stopping the domain
- Renaming / replacing image files on its final location - Renaming / replacing image files on its final location
- Starting the domain - Starting the domain
- Newest versions of virtnbdbackup don't require to start a domain each time you need to perform an incremental backup, but this is still required in order to create a new backup chain.