Just an example how to split snapshot storage destination from the primary pool with lvm:
To setup a snapback process, you need to have a local LV, with a snapshot, whose contents have been sent to a remote server, perhaps something like this:
lvcreate --snapshot -L10G -n somevm-snapback vmsrv1/somevm
dd if=/dev/vmsrv1/somevm-snapback bs=1M | pv -ptrb | \
ssh root@vmsrv2 dd of=/dev/vmsrv2/somevm
Now, you can run something like the following periodically (say, out of cron each hour):
lvcreate --snapshot -L10G -n somevm-snapback-new vmsrv1/somevm
lvmsync /dev/vmsrv1/somevm-snapback vmsrv2:/dev/vmsrv2/somevm --snapback \
/var/snapbacks/somevm.$(date +%Y%m%d-%H%M)
lvremove -f vmsrv1/somevm-snapback
lvrename vmsrv1/somevm-snapback-new somevm-snapback
But wait, there's more! lvmsync also has the ability to dump out the snapshot data to disk, rather than immediately applying it to another block device.
For example, if you just wanted to take a copy of the contents of a snapshot, you could do something like this:
lvmsync --stdout /dev/somevg/somelv-snapshot >~/somechanges
At a later date, if you wanted to apply those writes to a block device, you'd do it like this:
lvmsync --apply ~/somechanges /dev/somevg/someotherlv
You can also do things like do an lvmsync from the destination -- this is useful if (for example) you can SSH from the destination to the source machine, but not the other way around (fkkn firewalls, how do they work?). You could do this by running something like the following on the destination machine:
ssh srcmachine lvmsync --stdout /dev/srcvg/srclv-snap | lvmsync --apply - /dev/destvg/destlv