Problem:
Very large (400GB+) .qcow2 file that needs to be copied from HostA to HostB, where HostB is behind an ISP that does 24 hour disconnection of the connection.
Also because other people live in that household that use TV streaming, the bandwidth consumed should be limited.
In this case I’m on a 100MBit/s connection, and I’ll limit the transfer speed to 4MB/s.
We will use rsync for this.
The command is simply,
1 2 3 4 5 6 7 8 |
rsync \ --sparse \ --bwlimit=4000 \ --info=progress2 \ --partial \ --append-verify \ source_server_address:/var/lib/libvirt/images/image_name.qcow2 \ ./image_name.qcow2 |
sparse means, skip transfering zeroes or empty, unfilled data.
bwlimit=4000 means limit the transfer speed to 4000 kByte / second. aka 4Mbps.
info=progress2 shows a prettier progress than just --progress
partial and append-verify allows us the resume the transfer one the 24 hour disconnection kicks in, without needing to start from the beginning. It also verifies the transferred.