Question about directory structure of Simplestreams

Hello everyone,

Simplestreams are one method to distribute LXD images. It’s directory structure however does not seem to be publicly documented. I’ve found the lxd-image-server project on Github that provides an overview of the directory structure used by Simplestreams. A live-example can be traversed on Canonical’s own image server. The available images and their location are specified in images.json and index.json.

The used directory structure seems to look like this:

/                                       # root directory
|- images                               # images folder
|  `- ubuntu                            # environment
|     `- xenial                         # release
|        `- amd64                       # architecture
|           `- default                  # box type
|              `- 20180716_12:00        # version 1
|                 |- lxd.tar.xz         # index and templates
|                 `- rootfs.squashfs    # rootfs of container
`- streams
   `- v1
      |- index.json                     # index of products
      `- images.json                    # info with versions of products

images.json seems to just point to a location in the directory tree. Do images always have to be stored below the path /images/?

Or is it also possible to create additional subtrees like /images2/ and /images3/ to store images? In my scenario I plan to maintain the structure of the subtrees below /image*/ in regards to the release, processor architecture etc.

The only expectation as far as paths is that URL/streams/v1/index.json is available. Everything else is then loaded based on path references from the index files and so can be put wherever you want.

Thank you for confirming my assumption. I wasn’t sure if the directory structure is more a convention rather than a strict requirement.