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] Replicating a live server on a domU

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Replicating a live server on a domU
From: Simon Hobson <linux@xxxxxxxxxxxxxxxx>
Date: Thu, 29 Oct 2009 08:12:00 +0000
Delivery-date: Thu, 29 Oct 2009 01:17:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <000001ca5700$964bd890$c2e389b0$@ro>
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: <000001ca5700$964bd890$c2e389b0$@ro>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Alexandru Florescu wrote:

Has anybody ever stumbled upon the need to replicate a live and in production server to a virtual machine? I'm trying to virtualize a bunch of servers but I can't figure out how can I mirror the file system. I do not want to start from scratch with them.
The whole idea is to transfer them to the virtual side as they currently are.

Yes, I've done it several times - all Debian GNU/Linux systems of various vintages.

If you are prepared to modify the system, then install a Xen-ified kernel environment first - it makes things simpler. I just install a -xen kernel and let that take care of things like modules etc, but I dare say there are more efficient ways to do it if you aren't using pygrub.

Create new device files/volumes/whatever on the Dom0, mount them on Dom0 (eg you might have /mnt /mnt/var /mnt/home etc), and copy the filesystem across. Personally I normally use Rsync for this - but don't forget to use the "--numeric-ids" option to avoid ownerships getting mangled.

Before you unmount the volumes, go in and change things like fstab and network settings. Also, if you didn't do it earlier, chroot to the mountpoint (/mnt in the above example) and install the Xen-ified environment.

Unmount the volumes, setup the guest config file, boot guest (use -c option to attqch to console) and see what's broken.

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

Xen-users mailing list

<Prev in Thread] Current Thread [Next in Thread>