How to move/migrate LXD VM to another host on Linux

To move/migrate an LXD virtual machine to another host, follow these steps:

  1. On the source host, stop the LXD container:
lxc stop <container name>
  1. Export the container:
lxc export <container name> <file name>.tar.gz
  1. Copy the exported tar archive to the target host:
scp <file name>.tar.gz <user>@<target host IP address>:~/
  1. On the target host, import the container:
 
lxc import <file name>.tar.gz --rename <new container name>
  1. Start the imported container:
 
lxc start <new container name>
  1. Verify that the container is running correctly on the target host.

Note: Make sure that the LXD version on the target host is the same or higher than the one on the source host.

(Ambien)

Leave a Comment