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.

0644 root root /etc/modules-load.d/modules.conf
aufs
overlay
reboot

Remove security constraints on container.

0644 root root /etc/pve/lxc/{ID}.conf
lxc.apparmor.profile: unconfined
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
Start container and install docker.
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.

0644 root root /etc/docker/daemon.json
{
    "storage-driver": "overlay2"
}
service docker restart

Map proxmox ZFS drive to container.

Mount the ZFS volume for usage (proxmox shell).
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.

Reference

Reference

Migrate from XCP

See Exporting VM Disks to export disks first.

Copy disks to server.
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.

Find VM mounted disk and copy data to it.
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.