Migrate physical Server to LXC

Peter Pan

Member
Dec 15, 2015
8
0
21
34
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".
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!