abbbi / abbbi/virtnbdbackup

Support output type format "qcow"

Đang mở
#57 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement sponsor-me
Ngôn ngữ chính
Python
Star
518
Fork
57
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

During backup, another qemu-nbd process could be mapped to a target qcow image (just like it is happening during restore). The backup data could be directly sent to this process and the resulting backup image would be a standard qcow image, instead of the proprietary "sparsestream" image. This would ease things up during restore.

Proof of concept for Full Backup using nbdcopy (this only works for full backups, the logic would need to be implemted in virtnbdbackup to create inc/diff backups, too as nbdcopy does not support specifying bitmaps, see https://gitlab.com/nbdkit/libnbd/-/issues/7).

1) start nbd backup service on socket:

`./virtnbdbackup -l full -d vm1 -s -o /tmp/bla`

2) create qcow with same size and options like original one:

`qemu-img create -f qcow2 test.qcow2 50M`

3) copy data via nbdcopy to qcow file:

`nbdcopy -p nbd+unix:///sda?socket=/var/tmp/virtnbdbackup.16561 -- [ qemu-nbd -f qcow2 test.qcow2 ]`

Implementation could look like:

virtnbdbackup:

1) is extended with another output handler for option **-t qcow**
2) uses information from qcow image file that is already backed up to create the backup target file
3) starts an qemu-nbd process mapping the file
4) reads data using the extend header and writes it to the right offsets to the mapped nbd backend (with discard option so a thin provisioned backup file is created)
5) during incremental/differencial backup the same must happen with appropriate offsets to seperate qcow files.

virtnbdrestore:

1) is extended to detect if backup was done with -t qcow
2) uses appropriate qcow commands to rebase the images back to an full backup for restore
3) copies the files to the target host/directory

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.