|
|
|
|
|
|
|
|
|
|
xen-users
Re: [Xen-users] p2v migration + Xen
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
|
|
|
|
|