Some notes on how to migrate an Alpine Linux vserver to an lxcontainer.
Its fairly straightforward. Basically, the only thing that differs is:
On vserver the host sets up the network, on LXC the container needs to do it itself.
Here follows some step by step. build-edge-x86 is used as example.
Create the new container on the LXC host
Make a copy of the inittab to a location outside the container rootfs.
Use rsync to mirror the vserver. We do this before we shut down the vserver guest to keep downtime as low as possible. In this example we rsync from the vserver host:
While data is copying we can use the time to configure the network. Edit /var/lib/lxc/build-edge-x86/config and set up the network devices. In this example we do:
We can also create a interfaces file that we will copy into the container after old vserver is shutdown.
Shut down old vserver
After data is copied we shut down the old vserver. This is on old Vserver host.
We rename the vserver so its not started/copied by mistake.
We unmark the auto-start.
Mirror data again
We mirror the changes on the powered off vserver once again so we get the changes that happened after first data copy started. This is done from vserver host here.
Prepare lxcontainer for startup
Before we start up the container we copy the inittab. This is on new LXC host.
...and we copy the interfaces file too.
We make sure networking is started at bootup.
TODO: send GARP to tell switch of new ip.