I have a KVM host machine with several VMs on it. Each VM uses a Logical Volume on the host. I need to copy the LVs to another host machine.
Normally, I would use something like:
dd if=/the/logical-volume of=/some/path/machine.dd
To turn the LV into an image file and use SCP to move it. Then use DD to copy the file back to a new LV on the new host.
The problem with this method is you need twice as much disk space as the VM takes on both machines. ie. a 5GB LV uses 5GB of space for the LV and the dd copy also uses an additional 5GB of space for the image. This is fine for small LVs, but what if (as is my case) you have a 500GB LV for a big VM? The new host machine has a 1TB hard drive, so it can't hold a 500GB dd image file and have a 500GB logical volume to copy to and have room for the host OS and room for other smaller guests.
What I would like to do is something like:
dd if=/dev/mygroup-mylv of=192.168.1.103/dev/newvgroup-newlv
In other words, copy the data directly from one logical volume to the other over the network and skip the intermediate image file.
Is this possible?