Migration
Migration to PVE from other hypervisors and docker container imports.
Docker Migration
Proxmox can run docker in a LXC container until services are de-dockerized and moved.
Danger
high security risk. Most container security benefits are removed to enable docker to run in an LXC container. Migrate these services ASAP!
Enable container filesystem overlay for docker support.
aufs
overlay
reboot
Create container to host Docker
Memory is in MiB
not MB
. Create but do not start container. Note
the ID of the container.
datacenter › {SERVER} › 🖱 › create ct
General
› Hostname
HOST
› Unprivileged container
☑
› password
PASS
Template
› Storage
LOCAL
› Template
{CONTAINER IMAGE}
Root Disk
› Storage
local-lvm
› Disk size
20GB
CPU
› Cores
64
Memory
› Memory
125000
Updated: None
Remove security constraints on container.
lxc.apparmor.profile: unconfined
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
apt update && apt upgrade
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt update && apt install docker-ce docker-ce-cli containerd.io
Enable overlay filesystem for docker.
{
"storage-driver": "overlay2"
}
service docker restart
Map proxmox ZFS drive to container.
pct set {COTAINER ID} -mp{XX} mp=/host/dir,/container/mount/point
Note
XX
is the numeric mount point, starting at zero. See
/etc/pve/nodes/NODE/lxc/{ID}.conf
for available mount points.
Reboot container for the mountpoint to be added.
Migrate from XCP
See Exporting VM Disks to export disks first.
scp {VM}.raw {SERVER}:/var/lib/vz/images/
Create new VM with same disk size in local-lvm
. This should mirror
the existing VM configuration in the other hypervisor, including MAC, CPU, Disk,
and Memory. Ensure VM is off.
lvdisplay
dd if=/var/lib/vz/images/{VM}.raw bs=1M of=/dev/pve/{VM DISK}
Note
VM disk labels are generally in the format of vm-{ID}-disk-{NUMBER}
.
Tip
Start the VM. Verify that /etc/network/interfaces
use the correct
interfaces for the new VM.