Error in lxc image copy after upgrade to 4.19

After the cluster upgrade to version 4.19 find an issue in lxc image copy with projects. Steps to replicate error:

# Create a test container
$ lxc create ubuntu:20.04 test1 --project test1
$ lxc stop test1 --project test1
$ lxc publish test1 --alias test-image-1 --project test1
$ lxc image copy test-image-1 local: --auto-update --project test1
Error: Not Found
$ lxc image info test-image-1 --project test1

Fingerprint: xxxxxxxxxxxxxx (removed for clarity)
Size: 1449.47MB
Architecture: x86_64
Type: container
Public: no
Timestamps:
    Created: 2021/10/28 03:10 UTC
    Uploaded: 2021/10/28 03:10 UTC
    Expires: never
    Last used: never
Properties:
    description: Ubuntu 20.04 LTS server (20210825)
    os: ubuntu
    release: focal
    architecture: x86_64
Aliases:
    - test-image-1
Cached: no
Auto update: disabled
Profiles:
    - default

This used to work until version 4.18 and stopped working as soon as LXD upgrade to 4.19.

Probably some changes done in the new updates for image handling.

Please can you show the output of lxc project show test1?

The output of command is:

config:
  features.images: "true"
  features.profiles: "false"
  features.storage.volumes: "false"
description: ""
name: test1
used_by:
- /1.0/images/194281a78761e6c322b3d1a8bbeb418b6f43d1e0a2c19d807192b467d32f4739?project=test1
- /1.0/images/5fc94479f588171282beb094da96bb83eb51420d6cf13b223c737d1fda9169cd?project=test1
- /1.0/instances/test1?project=test1

I’m assuming you mean lxc launch rather than lxc create.

What did you expect to happen with this command?

lxc image copy test-image-1 local: --auto-update --project test1

Thanks

@stgraber do you know what this operation is supposed to do?

I’m confused why you would copy an already local image to local:?

I suspect the goal here is to copy the image across projects which should be fine, the auto-update part I’m not sure would work though, in theory we could store the source project in the image source and refresh across project so long as the source image is public.

One thing that got fixed in 4.19 is copy from remote servers when the image is not in the default project, so that may have affected the behavior for this command somehow.

In general the expectation is that if lxc project list shows you’re in the default project and you do lxc image copy some-image local: --project blah --alias some-image, this will look for an image called some-image in the default project and copy it to the blah project, also as some-image.

I get a different error when trying to copy an image by hash from default to another project:

lxc project ls
+-------------------+--------+----------+-----------------+----------+---------------------+---------+
|       NAME        | IMAGES | PROFILES | STORAGE VOLUMES | NETWORKS |     DESCRIPTION     | USED BY |
+-------------------+--------+----------+-----------------+----------+---------------------+---------+
| default (current) | YES    | YES      | YES             | YES      | Default LXD project | 4       |
+-------------------+--------+----------+-----------------+----------+---------------------+---------+
| test              | YES    | NO       | NO              | NO       |                     | 3       |
+-------------------+--------+----------+-----------------+----------+---------------------+---------+

lxc image ls
+-------+--------------+--------+-------------------------------------+--------------+-----------------+----------+-------------------------------+
| ALIAS | FINGERPRINT  | PUBLIC |             DESCRIPTION             | ARCHITECTURE |      TYPE       |   SIZE   |          UPLOAD DATE          |
+-------+--------------+--------+-------------------------------------+--------------+-----------------+----------+-------------------------------+
|       | a33719937baa | no     | Ubuntu focal amd64 (20211018_07:42) | x86_64       | CONTAINER       | 103.43MB | Oct 26, 2021 at 12:53pm (UTC) |
+-------+--------------+--------+-------------------------------------+--------------+-----------------+----------+-------------------------------+
|       | d91bf665b110 | no     | Ubuntu focal amd64 (20211018_07:42) | x86_64       | VIRTUAL-MACHINE | 241.38MB | Oct 26, 2021 at 12:53pm (UTC) |
+-------+--------------+--------+-------------------------------------+--------------+-----------------+----------+-------------------------------+

lxc image copy a33719937baa local:  --project test
Error: The source server isn't listening on the network

Ah yeah, I don’t know if we have an API for a server-local copy of an image like that or if it’s indeed hitting the network and transfers it from itself (obviously not ideal).

Right I mean lxc launch.

The expectation is to change the image to auto-update. It worked fine in versions earlier than 4.19. It just updates the image flag of auto-update.

Please could you open an issue over at https://github.com/lxc/lxd/issues so we can track this.

Please add on there the reproducer steps and what you expected it to do.

Thanks

Also, does lxc image edit <image> work for you, when changing the auto_update property?

Maybe we need an lxc image set command @stgraber

Created the issue. at https://github.com/lxc/lxd/issues/9525

1 Like