Image aliases are not copied

Hi guys! Why if I copy remote lxd container image with enabled option --copy-aliases and virtual machine image also with enabled option --copy-aliases, then only aliases for virtual machine or container image are set but not to both images?

$ lxc image alias ls
+---------------------------+--------------+-----------+-------------+
|           ALIAS           | FINGERPRINT  |   TYPE    | DESCRIPTION |
+---------------------------+--------------+-----------+-------------+
| alpine/3.14               | bc4fabec3915 | CONTAINER |             |
+---------------------------+--------------+-----------+-------------+
| alpine/3.14/amd64         | bc4fabec3915 | CONTAINER |             |
+---------------------------+--------------+-----------+-------------+
| alpine/3.14/default       | bc4fabec3915 | CONTAINER |             |
+---------------------------+--------------+-----------+-------------+
| alpine/3.14/default/amd64 | bc4fabec3915 | CONTAINER |             |
+---------------------------+--------------+-----------+-------------+
$ lxc image ls
+----------------------+--------------+--------+------------------------------------+--------------+-----------+--------+------------------------------+
|        ALIAS         | FINGERPRINT  | PUBLIC |            DESCRIPTION             | ARCHITECTURE |   TYPE    |  SIZE  |         UPLOAD DATE          |
+----------------------+--------------+--------+------------------------------------+--------------+-----------+--------+------------------------------+
| alpine/3.14 (3 more) | bc4fabec3915 | no     | Alpine 3.14 amd64 (20210821_13:00) | x86_64       | CONTAINER | 2.90MB | Aug 21, 2021 at 9:36pm (UTC) |
+----------------------+--------------+--------+------------------------------------+--------------+-----------+--------+------------------------------+
$ lxc image copy images:0f5b2feca685 local: --copy-aliases --auto-update
Image copied successfully!                   
$ lxc image ls
+----------------------+--------------+--------+------------------------------------+--------------+-----------------+---------+------------------------------+
|        ALIAS         | FINGERPRINT  | PUBLIC |            DESCRIPTION             | ARCHITECTURE |      TYPE       |  SIZE   |         UPLOAD DATE          |
+----------------------+--------------+--------+------------------------------------+--------------+-----------------+---------+------------------------------+
| alpine/3.14 (3 more) | 0f5b2feca685 | no     | Alpine 3.14 amd64 (20210821_13:00) | x86_64       | VIRTUAL-MACHINE | 94.69MB | Aug 21, 2021 at 9:39pm (UTC) |
+----------------------+--------------+--------+------------------------------------+--------------+-----------------+---------+------------------------------+
|                      | bc4fabec3915 | no     | Alpine 3.14 amd64 (20210821_13:00) | x86_64       | CONTAINER       | 2.90MB  | Aug 21, 2021 at 9:36pm (UTC) |
+----------------------+--------------+--------+------------------------------------+--------------+-----------------+---------+------------------------------+
$ lxc image alias ls
+---------------------------+--------------+-----------------+-------------+
|           ALIAS           | FINGERPRINT  |      TYPE       | DESCRIPTION |
+---------------------------+--------------+-----------------+-------------+
| alpine/3.14               | 0f5b2feca685 | VIRTUAL-MACHINE |             |
+---------------------------+--------------+-----------------+-------------+
| alpine/3.14/amd64         | 0f5b2feca685 | VIRTUAL-MACHINE |             |
+---------------------------+--------------+-----------------+-------------+
| alpine/3.14/default       | 0f5b2feca685 | VIRTUAL-MACHINE |             |
+---------------------------+--------------+-----------------+-------------+
| alpine/3.14/default/amd64 | 0f5b2feca685 | VIRTUAL-MACHINE |             |
+---------------------------+--------------+-----------------+-------------+

I want to have aliases for both types of copied images from images: to local:
What should i do to have aliases copied both for container and vm images?
Any ideas how to resolve this name conflict?

LXD does not support the same alias being used for both container and virtual machines.
This is supported by upstream image servers because they do not use the LXD protocol and instead use simplestreams which does allow for this.

2 Likes