Re: [Xen-users] migrate virtual machine to another server

Dmitry Nedospasov
Sat, 14 May 2011 12:54:43 -0000

I felt i should jump in :)

Whenever I do a "vm move" I preffer to keep a snapshot of the machine
just in case.

On Fri, May 13, 2011 at 11:59:03AM -0400, John Madden
wrote:
> Tsk, tsk.  Do it in one step:
>
> dd if=/dev/mapper/srcdisk bs=1M | ssh root@targetserver "dd
> of=/dev/lvm/tgtdisk bs=1M"

To save you some space, you can simply "gzip" the disk:

dd if=/dev/mapper/srcdisk bs=64k | gzip -c > srcdisk.gz

This has saved me a lot of space. I always smile when my 20-50GB lvm
volumes suddenly take up just 5GB of disk space.

And obviously you can gzip over ssh too, you''ll just need to gunzip -c
and dd with the correct bs on the other end. Depending on your upload
speed, this might actually save you some time. I use this to pull images
down (over ADSL) from my hoster to the xen test server i have at home.

D.
--
Dmitry Nedospasov <dmitry@nedos.net> -- Twitter: @nedos
Web: http://nedos.net -- Github: http://github.com/nedos