Compare commits
9 Commits
14fc845bf8
...
5bc5cf3a99
Author | SHA1 | Date | |
---|---|---|---|
5bc5cf3a99 | |||
b67847b652 | |||
345f120b46 | |||
|
457a463f62 | ||
|
b9171b1ab8 | ||
|
905de502b1 | ||
|
0f89ddf7ee | ||
|
498d36326e | ||
|
ae674246cf |
@ -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.description="virtnbdbackup and virtnbdrestore (plus depedencies) to run on hosts with libvirt >= 6.0.0"
|
||||
LABEL container.source=$source
|
||||
LABEL container.version="1.0"
|
||||
LABEL container.version="1.1"
|
||||
LABEL maintainer="Adrián Parilli <a.parilli@staffwerke.de>"
|
||||
|
||||
# Deploys dependencies and pulls sources, installing virtnbdbackup and removing unnecessary content:
|
||||
RUN \
|
||||
apt-get update && \
|
||||
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 && \
|
||||
cd virtnbdbackup && python3 setup.py install && cd .. && \
|
||||
apt-get purge -y git ca-certificates && apt-get -y autoremove --purge && apt-get clean && \
|
||||
|
48
README.md
48
README.md
@ -14,7 +14,7 @@ It has been successfully tested on UnRaid v6.9.2, but should work the same on ma
|
||||
## Requirements:
|
||||
- Docker Engine. See [Docker Documentation](https://docs.docker.com/get-docker/) for further instructions
|
||||
- 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.
|
||||
|
||||
@ -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 \`
|
||||
|
||||
`docker-virtnbdbackup \`
|
||||
`adrianparilli/virtnbdbackup-docker \`
|
||||
|
||||
`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 \`
|
||||
|
||||
`docker-virtnbdbackup \`
|
||||
`adrianparilli/virtnbdbackup-docker \`
|
||||
|
||||
`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 \`
|
||||
|
||||
`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.
|
||||
|
||||
### 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.)
|
||||
### Interactive mode / debugging virtnbdbackup:
|
||||
|
||||
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' \`
|
||||
|
||||
`docker-virtnbdbackup \`
|
||||
`adrianparilli/virtnbdbackup-docker \`
|
||||
|
||||
`/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:
|
||||
|
||||
- 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:
|
||||
- Stopping the domain
|
||||
- Renaming / replacing image files on its final location
|
||||
- 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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user