LXD import issues on LXD 2.0.11

Hi there, I started managing a server which runs Ubuntu 16.04 with LXD 2.0.11. There are snapshots being taken daily on this machine, and those are copied to a backup server. Before we upgrade LXD and Ubuntu on it, I would really like to make sure that I can recover the containers I have there. I’ve copied all the files belonging to one container to a similar machine, first mounting the right folder in ZFS (the folder is /var/lib/lxd/containers/testserver.zfs/, as that seems to be the location the datasets in this version of LXD), then copying all the files to that folder (anything to think about when it comes to the owner of rootfs?)

I have also created a symlink to the new testserver.zfs/-folder in /var/lib/lxd/containers/.

When I finally run lxd import testserver, I just get the following error:

error: Unknown arguments

I tried to find documentation about LXD’s earlier versions online, but to no avail. I really want to make sure I can restore these containers (which do not contain the backup.yaml file) before I upgrade LXD.

Any assistance would be appreciated!

lxd import doesn’t exist on LXD 2.0.x so you’ll be missing the needed backup.yaml file to make this feature work.

The documentation for 2.0.x can be found here: http://lxd.readthedocs.io/en/stable-2.0/

To make the upgrade smoother, I’d recommend upgrading LXD to 2.21 on Ubuntu 16.04 first, then proceeding with the upgrade to Ubuntu 18.04 which will get you to LXD 3.0.

You can do so with:

  • apt install -t xenial-backports lxd lxd-client

After that’s done, confirm that all containers and networks work (that’s the most complex part of that upgrade), if all looks good, then you’re ready for the Ubuntu upgrade.

Once you’re on 2.21, you’ll also get the new backup.yaml files and will be able to use lxd import should something go wrong during the 3.0 upgrade.

Thank you! The upgrade to 2.21 went flawlessly, now In can be relaxed.