Import image from lxd 2.0 to lxd 4.0

I have exported an image from our legacy server running on ubuntu 15.10 using lxd version 2.0. I am trying to import the image into our new server running on version 22.04 using lxd version 5.18.

I exported the image using the lxc image export . there was only one tar file created and no metadata tar file was created. when i imported into the new server i get the error " [Error: Metadata tarball is missing metadata.yaml]"

can you please help me

Hmm, I’m not sure exactly what you got from lxc image export.

LXD supports two image formats, one that is made of a single large tarball which includes a metadata.yaml file at its root along with a rootfs folder containing the rest of the image. The other, much more common these days is made of two tarballs, one metadata tarball containing metadata.yaml and one tarball containing the rootfs.

LXD never supported a single tarball with no metadata.yaml inside it, so if you only have a rootfs tarball, then look around on the box where you ran lxc image export as chances are, there’s another file in that folder.

Worst case scenario, you can always create your own metadata tarball containing a very minimal metadata.yaml file.

PS: LXD is no longer part of Linux Containers, so this question really should go on Canonical’s forum instead.