This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


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

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] migrate virtual machine to another server
From: Dmitry Nedospasov <dmitry@xxxxxxxxx>
Date: Sat, 14 May 2011 14:54:43 +0200
Delivery-date: Sat, 14 May 2011 05:56:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DCD5547.7040302@xxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <C9F31CFA.2872%bolognani@xxxxxxxxxx> <BANLkTi=fP4tODMjxfdMb4ykP_-hDvoEd+g@xxxxxxxxxxxxxx> <4DCD5547.7040302@xxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
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.

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

Xen-users mailing list