How to migrate a regular LXC container to a Proxmox LXC container?
Without detailed explanation here is how you can do this.
- Create an archive of your LXC container.
- Create a Proxmox Container using that archive as a template.
First cd into your lxc container root directory:
(If you used an lvm volume as your containers storage, you need to mount it and cd into your mount point, which can be done by
mount /dev/mapper/<lvgroup-lvdisk> /var/lib/lxc/debian8/rootfs/, and than cd into the mount point)
Create an archive:
tar -czvf /var/lib/vz/template/cache/my_debian8_template.tar.gz ./
Then create a new proxmox container out of that
pct create 100 /var/lib/vz/template/cache/my_debian8_template.tar.gz \
-description LXC -hostname pvecontainer01 -memory 1024 -nameserver 22.214.171.124 \
-net0 name=eth0,hwaddr=52:4A:5E:26:58:D8,ip=192.168.15.147/24,gw=192.168.15.1,bridge=vmbr0 \
-storage local -password changeme
(You can modify your options as you would like.)
For more information see - man pct