OpenVZ Forum


Home » General » Support » *SOLVED* FC3 p2v migration
*SOLVED* FC3 p2v migration [message #2605] Tue, 11 April 2006 11:39 Go to next message
Toerkeium is currently offline  Toerkeium
Messages: 2
Registered: April 2006
Junior Member
Hello Guys.

I have been trying to do a p2v migration, from a box running FC3 to a vps. What is did is the following:

1.- in Physical box: rsync -avz / root@harwardnode:/vz/private/103/

2.- When it finished, I copied the /dev folder from another VPS to the VPS 103 with rsync command.

I have created previously the 103 VPS with FC3 template, so I have all configs ready for it.

after that, I followed a few suggestions found in this forum:

vzctl set 103 --ipadd x.x.x.x --save
disable getty in /etc/inittab:
link /etc/mtab to /proc/mounts

and when I try to start the vps, it seems to start ok, or atleast vzctl doesn't show any error. But VPS doesn't responde to a "ping", or "vzctl enter 103" command

Then I copied /etc from a fresh vps install, and it works. so I just compared folders, and tried to reproduce the same config, ie: fstab content, symlinks, etc. But nothing happens.

I think I am missing something clearly in /etc, but I can't figure it out.

If anyone could give me an idea on where to look, it would be very appreciated.

VZCTL error while trying to "enter the VPS" is

[root@vps 103]# vzctl --verbose enter 103
enter failed

Thanks in advance,

Toe!

[Updated on: Thu, 03 August 2006 13:24] by Moderator

Report message to a moderator

Re: FC3 p2v migration [message #2615 is a reply to message #2605] Tue, 11 April 2006 15:09 Go to previous messageGo to next message
Toerkeium is currently offline  Toerkeium
Messages: 2
Registered: April 2006
Junior Member
OK, it's fixed now. Of course, by dev.. not me Smile))

After this, I would like to say 2 things to consider in order to migrate a physical server to a VPS (p2v), again, these are recommendations dev gave me.

1.- Removing all daemons which works directly to hardware, since there is no hardware involved directly with VPSs.

2.- Remove al unnecesary daemons to increase performance (things that unexpert admins do, like me) and in my case, I had dev mounted as tmpfs, which is not recommended because of its excesive consumption

so, this is what I did, mixed with what dev did:

Create a new VPS (in my case was FC3), and the only purpose to create a new VPS will be to have the configuration file made by vzctl, instead of manually. Lets assume the use of VPS 103, in which will be copy the entire physical box OS:

create the vps:
vzctl create 103 --ostemplate fedora-core-3 --config vps.basic]


set it to boot on HW start:
vzctl set 103 --onboot yes --save


set up a hostname:
vzctl set 103 --hostname host.yourdomain.com --save


set up an ip address:
vzctl set 103 --ipadd 10.10.10.100 --save


In case your Physical OS doesn't fee any cached template, you can do just the 103 directory, and generate the configuration file fot the vps /etc/sysconfig/vz-scrips/103.conf.

rsync the physical box into the vps

from the HOST or Hardware-Node:
rsync -avz root@ip-of-box-to-migrate:/ /vz/private/103/


NOTE: In my case, when I tried to start the vps after syncing the physical box, it started, but I wasn't able to connect to it throu ssh or "vzctl enter 103" command. The problem was that as I used the basic.vps, the vps was little in resources to start, so incresing values fixed that.


now I have the VPS which id is 103 with my physical FC3 box OS in it.

customization:

use the fol command to turn off kudzu (in case you have it):
vzctl exec 103 /sbin/chkconfig kudzu off


increase memory parameters (if you need more; I needed):
vzctl set 103 --kmemsize 6000000:6500000 --save


remove daemons which speak directly to hardware:

rpm -e --nodeps acpid apmd irqbalance pcmcia messagebug haldaemon nfslock rpcsvcgssdged netfs rpcidmapd most likely autofs isdn gpm cups cpuspeed smartd mdmonitor


also if don't need NFS and such, better disable

I cound't use the "vzctl enter 103" command at this point, which was fixed issuing this command in thr HN to increase dcachesize:
vzctl set 103 --dcachesize 2000000:2000000 --save


About the issue of having /dev mounted as tmpfs:

*<swdev]> I fixed it, by removing udev and installing vzdev-*rpm
*<kir> Toerkeium, basically what you need to do before you start a VPS migrated from the physical server is:
*<kir> (1) chroot into /vz/private/NNN
*<kir> (2) rpm -e --nodeps udev
*<kir> (3) rpm -ihv vzdev*.rpm
*<kir> vzdev rpm is available from /vz/template/fedora-core/N/i386/vz-addons

so, lets do what people who knows tell us:
cp /vz/template/fedora-core/3/i386/vz-addons/* /vz/root/103/



now lets enter the VPS:
vzctl enter 103


rpm -e --nodeps udev
rpm -ihv vzdev*.rpm
rpm -ihv dummy-fedora-core-3-1.0-3.swsoft.i386.rpm


Disable SELinux (inside the vps):
/etc/selinux/config: SELINUX=disabled


make mtab a symlink of /proc/mounts:
rm -f /etc/mtab
ln -s /proc/mounts /etc/mtab


Now lets exit from the VPS:
exit


I didn't have /dev/tty entries, so to create them:

vzctl exec 103 MAKEDEV tty
vzctl exec 103 MAKEDEV pty


End.

that should be all. It's working for me. THanks os much to dev for his help!
Re: FC3 p2v migration (FC4 also *SOLVED*) [message #4934 is a reply to message #2615] Thu, 03 August 2006 12:53 Go to previous message
xinhes is currently offline  xinhes
Messages: 6
Registered: August 2006
Location: Sundsvall, Sweden
Junior Member
This guide was useful and worked for FC4 also, but I still have a problem with /proc now showing up inside the migrated VPS.

Take a look at this:
# uname -a
Linux X 2.6.16-026test015.2 #1 Fri Jul 14 16:09:51 MSD 2006 i686 athlon i386 GNU/Linux
# vzctl start 1002
Starting VPS ...
VPS is mounted
Adding IP address(es): X.X.X.X
Setting CPU units: 1000
Set hostname: vs01.ipone.net
File resolv.conf was modified
VPS start in progress...
# vzctl enter 1002
entered into VPS 1002
-bash-3.00# ps
Error, do this: mount -t proc none /proc
-bash-3.00# mount -t proc none /proc
-bash-3.00# ps
PID TTY TIME CMD
24566 ttyp0 00:00:00 bash
25630 ttyp0 00:00:00 ps
-bash-3.00# exit
logout
exited from VPS 1002
--

Q: Anyone know whats wrong with my migrated FC4 install?

A:
I had migrated from a vserver installation and /etc/inittab had this in it:
si::sysinit:/etc/rc.d/rc.sysinit.vserver

I found it when i got suspisious on the initscrips and ran:
# rpm -qV initscripts and found that /etc/inittab was modified
Smile
*SOLVED*

[Updated on: Thu, 03 August 2006 13:13]

Report message to a moderator

Previous Topic: gfs does not compile with openvz kernel
Next Topic: Using IPTables MAC Filter Module in VE ?
Goto Forum:
  


Current Time: Thu Jul 18 22:34:29 GMT 2024

Total time taken to generate the page: 0.02578 seconds