I have a few physical nodes which I ran KVM guests on. Occasionally I need to rebuild the host, so I want to copy the VM from one physical node to another. I use RAW (sparse) disk images and standard scp would copy the image in it's entirety. Until... I found rsync -S ;-)
rsync -Surpolvv * usgtst92:/var/lib/libvirt/images/
*** SOURCE ***
usgtst91 images]# for IMG in `find . -name "*.img"`; do qemu-img info $IMG; done
image: ./DVGLLVUSGTST82/DVGLLVUSGTST82.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 12G
image: ./DVGLLVUSGTST81/DVGLLVUSGTST81.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 4.0G
image: ./DVGLLVUSGTST83/DVGLLVUSGTST83.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 3.8G
*** DESTINATION ***
usgtst92 images]# for IMG in `find . -name "*.img"`; do qemu-img info $IMG; done
image: ./DVGLLVUSGTST83/DVGLLVUSGTST83.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 3.2G
image: ./DVGLLVUSGTST81/DVGLLVUSGTST81.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 3.4G
image: ./DVGLLVUSGTST82/DVGLLVUSGTST82.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 11G
rsync -Surpolvv * usgtst92:/var/lib/libvirt/images/
*** SOURCE ***
usgtst91 images]# for IMG in `find . -name "*.img"`; do qemu-img info $IMG; done
image: ./DVGLLVUSGTST82/DVGLLVUSGTST82.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 12G
image: ./DVGLLVUSGTST81/DVGLLVUSGTST81.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 4.0G
image: ./DVGLLVUSGTST83/DVGLLVUSGTST83.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 3.8G
*** DESTINATION ***
usgtst92 images]# for IMG in `find . -name "*.img"`; do qemu-img info $IMG; done
image: ./DVGLLVUSGTST83/DVGLLVUSGTST83.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 3.2G
image: ./DVGLLVUSGTST81/DVGLLVUSGTST81.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 3.4G
image: ./DVGLLVUSGTST82/DVGLLVUSGTST82.img
file format: raw
virtual size: 44G (47244640256 bytes)
disk size: 11G
This is the simplest, clearest explanation of this topic I have found. Thanks!
ReplyDeletelinux scp
Really helpful down to the ground, happy to read such a useful post. I got a lot of information through it and I will surely keep it in my mind. Keep sharing. Otherwise If If any one who want to learn linux core to advance Get a free demo call on 9311002620 or visit https://htsindia.com/Courses/modular-courses/redhat-linux-administration-training-course
ReplyDelete