Downloading a complete list of remote images (including virtual machines)

I am trying to get a full list of images for both containers and virtual machines, normally I send a GET request to https://images.linuxcontainers.org:8443 however the virtual machine images are not showing up.

For example image Ubuntu focal arm64 with fingerprint fc9938212e49 is not on that list.

Please can you point me in the right direction. Thanks.

We consider https://images.linuxcontainers.org:8443 to be legacy. LXD these days uses simplestreams with most of its public image servers as that’s a lot less hackish than having to pretend to implement a rest api on a static web server :slight_smile:

https://images.linuxcontainers.org/streams/v1/images.json

This contains everything we expose. If you look for your fingerprint in there, you should find the matching record.

That is even easier, is that now the official way to do this? I am mean can I implement this safely in an application without worrying about it breaking (asking because it seems strange that the JSON is just waiting for me).

Yeah, technically LXD hits https://images.linuxcontainers.org/streams/v1/index.json which then points to images.json. If you do the same, then you’re good.

And you can do the same thing against https://cloud-images.ubuntu.com/releases/streams/v1/index.json if you want to access the ubuntu: remote.

thanks.

When running lxc launch images:ubuntu/focal u2, how does LXC determine which version, looking at the contents of the file, LXC is not using the latest, is there a reason for that? I am just trying to determine which fingerprint to use.

Also if i am understanding the format correctly, combined_squashfs_sha256 refers to the fingerprint for a container and combined_disk-kvm-img_sha256 is for a virtual machine.

LXD is supposed to pull the latest image though note that LXD itself has a simplestreams cache to avoid needlessly re-downloading the index so there may be a bit of latency.

You can use lxc image info images:whatever to query directly without any caching.

Here I’m seeing:

stgraber@castiana:~$ lxc image info images:ubuntu/focal
Fingerprint: bd999bbcba6fb30952d60c96f40008781092b6d9a1be32c475bcef98369f422f
Size: 102.29MB
Architecture: x86_64
Type: container
Public: yes
Timestamps:
    Created: 2021/06/18 00:00 UTC
    Uploaded: 2021/06/18 00:00 UTC
    Expires: never
    Last used: never
Properties:
    description: Ubuntu focal amd64 (20210618_07:42)
    variant: default
    os: Ubuntu
    release: focal
    architecture: amd64
    serial: 20210618_07:42
    type: squashfs
Aliases:
    - ubuntu/focal/default
    - ubuntu/focal/default/amd64
    - ubuntu/20.04/default
    - ubuntu/20.04/default/amd64
    - ubuntu/focal
    - ubuntu/focal/amd64
    - ubuntu/20.04
    - ubuntu/20.04/amd64
Cached: no
Auto update: disabled
Profiles: []
stgraber@castiana:~$ lxc image info images:ubuntu/focal --vm
Fingerprint: acd2a4331c42385991815083a8fc2547257abe7c037ff64b11cc7afd05bbd566
Size: 240.13MB
Architecture: x86_64
Type: virtual-machine
Public: yes
Timestamps:
    Created: 2021/06/18 00:00 UTC
    Uploaded: 2021/06/18 00:00 UTC
    Expires: never
    Last used: never
Properties:
    os: Ubuntu
    release: focal
    variant: default
    architecture: amd64
    serial: 20210618_07:42
    description: Ubuntu focal amd64 (20210618_07:42)
    type: disk-kvm.img
Aliases:
    - ubuntu/focal/default
    - ubuntu/focal/default/amd64
    - ubuntu/20.04/default
    - ubuntu/20.04/default/amd64
    - ubuntu/focal
    - ubuntu/focal/amd64
    - ubuntu/20.04
    - ubuntu/20.04/amd64
Cached: no
Auto update: disabled
Profiles: []

Thats fine, thanks for explaining, my gut reaction was to download the latest, but i was wondering why that was not happening in LXD, so obviously the cache is too blame. The version you showed there, is from 3 days ago, there were two updates since then. Thank you very much.

I’m confused, I’m showing 20210618_07:42 which is from earlier this morning.

There are currently 3 images for ubuntu/20.04:

  • 20210618_07:42
  • 20210616_07:42
  • 20210615_07:42

Sorry for the confusion, it is not your response that is cached from a few days ago, but on one my installations. I am getting the b2bb76a83d4c fingerprint which is from 20210616_07:42.