Migrate physical Server to LXC

Peter Pan

Member
Dec 15, 2015
8
0
21
35
Hi

I was trying the last few days to migrate an old Debian 6.0 system to proxmox 4.1 LXC as follow:

- create a new lxc container with debian 6.0 template through proxmox webadmin
- stop container and mount loop device of raw image -> /mnt
- rename all top folders to *.save, eg. /mnt/var -> /mnt/var.save
- rsync all data from physical server to /mnt
- rename /mnt/dev.save to /mnt/dev
- unmount loop device and start container through proxmox webadmin
- no errors but server is not running (no prompt in console, no ping etc.)

What is the right way for a successfull migration?


Thanks for any help.
 
try starting the lxc from cli in debug mode. there may be error messages to help fix . for example:
Code:
lxc-start -n 35444  -F --logfile=lxc.log --logpriority=debug
 
Container is now running thanks to RobFantini. Start up conainer in the console as foreground process shows every error. I had also the opportunity to continue boot process with ctrl-D.

Main problem was fstab issue but also eth0. To overcome all problems I did the following:

  1. stop container and mount loop device of raw image -> /mnt
  2. cd /mnt
  3. mv etc etc.old (save etc from our migrated server)
  4. cp -a etc.save etc (this is the initial etc created through proxmox create container)
  5. cd / && umount /mnt && lxc-start -n 100 -F --logpriority=debug

System starts without any problems, ping works!

The only work left is to copy some /etc.old configurations to /etc. This command will help to find differences: "diff -q etc etc.old".