Migration

You can clone a container to a different node using vzdump output piped to a pct restore command ran over SSH.

The SSH connection must be configured with SSH keys for passwordless authentication!

screen -R migration -L -Logfile ~/migration-$(date +%s)
pct stop ${ctid}
time vzdump ${ctid} --dumpdir /var/lib/vz/dump --stdout  | ssh root@remote-server-ip pct restore --rootfs ${disk size} --storage=${remote storage} ${ctid} -

You need to manually specify the rootfs size in G (without specifying it) on the destiantion, to match the source

- at the end is needed to fetch the container backup from stdout