WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] p2v migration + Xen

Subject: Re: [Xen-users] p2v migration + Xen
From: mark foster <mark@xxxxxxxxx>
Date: Tue, 18 Apr 2006 07:25:22 -0700
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 18 Apr 2006 07:26:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <32733.194.203.13.71.1145364797.squirrel@xxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <32733.194.203.13.71.1145364797.squirrel@xxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
Dan Hawker wrote:

>We have a machine in place that I would like to migrate, however am unsure
>as to what the best option would be. I am not going to get much time for
>the machine in question to be *not available*, so wondered if I could use
>rsync or similar to create a backup of the filesystem in question directly
>into a directory structure on the new server for the resultant Xen VM. I
>could do this whilst all things are still live. At the moment we'd like to
>swap over, we could then do a quick and final rsync, turn off the original
>server and bring the Xen VM up.
>
>Does this make sense??? I presume there will be some directories and files
>that shouldn't be migrated (/dev, /tmp, etc) which files/dirs are safe to
>leave behind???
>  
>
This is how I've done it, seems to work pretty well.
First mount up your prepped Xen disk (file-backed image or LVM,
whatever) in Dom0 under /mnt/tmp.
You will have to create the partition/volume/file and mkfs it.

Then use...

rsync -av -e ssh
 -n \ #dry run
 -S \ # handle sparse files
 -H \ # Preserve hard links
 -W \ # copy files whole
 -D \ # also get device files
 --exclude-from="XenCloneExclude" \
 root@srchost:/ /mnt/tmp

 rsync -av -e ssh  -n -S -H -W -D --exclude-from="XenCloneExclude" 
root@srchost:/ /mnt/tmp

Remove the -n for the real deal.

The contents of XenCloneExclude are:

proc/*
tmp/*
lost+found/
etc/mtab

Adjust to your environment.

Make sure to run the srchost is in single-user mode (with network up) or
shutdown as many services as you possibly can to reduce the chance of
data changing beneath you.

After copying the data over you can edit /etc/fstab, /etc/hosts and a
few other important files to adjust the image for the new environment.

-- 
Some days it's just not worth chewing through the restraints...
Mark D. Foster, CISSP <mark@xxxxxxxxx>  http://mark.foster.cc/



_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

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