OS version missing from "lxc list" command

Greetings all,

We have spun up a number of CentOS 6.5 containers from the “standard” images repository (https://images.linuxcontainers.org) and it seems the container OS version is not getting set. Running the command “lxc list -c4scl,image.os,image.release” or "lxc config show " does not return anything about the base image.

Given we used the standard image repository, I would expect these fields to have the right value. Any idea why these fields are empty? Also, how can we manually populate them with the correct data?

-Ron

What version of LXD are you running?

With LXD 2.18, I get the following which is OK.

$ lxc list -c4scl,image.os,image.release
+--------------------------------+---------+----------------------+----------------------+----------+---------------+
|              IPV4              |  STATE  |      CREATED AT      |     LAST USED AT     | IMAGE OS | IMAGE RELEASE |
+--------------------------------+---------+----------------------+----------------------+----------+---------------+
| 10.52.252.115 (eth0)           | RUNNING | 2017/10/03 10:40 UTC | 2017/11/15 21:26 UTC | ubuntu   | xenial        |
+--------------------------------+---------+----------------------+----------------------+----------+---------------+
| 10.52.252.146 (eth0)           | RUNNING | 2017/11/16 00:04 UTC | 2017/11/16 00:04 UTC | Centos   | 7             |
+--------------------------------+---------+----------------------+----------------------+----------+---------------+

…various. 2.13, 2.15, 2.16

It seems one of our source baseline images don’t have these fields set. As a result, any copies/clones of this image don’t have the fields either.

How can we manually populate these values on our baseline image?

-Ron

lxc image edit will let you update the image properties. On recent LXD those properties are then copied onto the container as image.NAME keys which can then be used in lxc list as @simos showed above.

Thanks. We have literally hundreds of containers with this issue. Is there any sort of cli “kung-fu” I can use to update them instead of using lxc image edit?

-Ron

For existing containers, you’d want to lxc config set NAME image.os ubuntu and lxc config set NAME image.release xenial in a loop for all your containers.