Building centos/9-Stream/cloud image missing metadata.yaml error message

Looking for some help… am trying to build a Centos/9-Stream/cloud image for LXD I’ve downloaded the centos.yaml from lxc-ci and I got the distrobuilder arguments from Jenkins.

The distrobuilder docs seemed to indicate I should do a build-dir and then a pack-lxc

distrobuilder build-dir  centos.yaml $PWD/centos -o image.architecture=x86_64 -o image.release=9-Stream -o image.variant=cloud -o source.variant=boot -o 
source.url=https://mirror1.hs-esslingen.de/pub/Mirrors/centos-stream

distrobuilder pack-lxc centos.yaml $PWD/rootfs $PWD/images

Both work ok… (warnings about overs not being supported)…

When I attempt to import the image…

lxc image import meta.tar.xz rootfs.tar.xz --alias centos/9-Stream/cloud
Error: Metadata tarball is missing metadata.yaml

I get

Error: Metadata tarball is missing metadata.yaml

[root@mdev images]# tar tvf meta.tar.xz
-rw-r--r-- root/root        61 2024-02-28 12:38 create-message
-rw-r--r-- root/root        11 2024-02-28 12:38 expiry
-rw-r--r-- root/root         1 2024-02-28 12:38 excludes-user
-rw-r--r-- root/root        64 2024-02-28 12:38 config
-rw-r--r-- root/root       110 2024-02-28 12:38 config-user
-rw-r--r-- root/root       124 2024-02-28 12:38 config-user.1
-rw-r--r-- root/root       124 2024-02-28 12:38 config-user.2
-rw-r--r-- root/root       124 2024-02-28 12:38 config-user.3
-rw-r--r-- root/root       124 2024-02-28 12:38 config-user.4
-rw-r--r-- root/root        71 2024-02-28 12:38 config.1
-rw-r--r-- root/root        71 2024-02-28 12:38 config.2
-rw-r--r-- root/root        71 2024-02-28 12:38 config.3
-rw-r--r-- root/root        71 2024-02-28 12:38 config.4
-rw-r--r-- root/root        34 2024-02-28 12:38 templates

build-lxc is for building LXC images, not LXD.

You’ll want build-incus for the Incus/LXD image type.

1 Like

Oops, I said build instead of pack here as that’s likely what you actually want to use.
build-incus is equivalent of build-dir + pack-incus.

The reason why we do it in two steps in our CI is because we produce both LXC and Incus images so that lets us use the same rootfs for both. But if all you care about is the LXD/Incus image, just use build-incus directly.

1 Like

Thanks works fine with pack-incus and build-incus