Add support for "friendly" image names

Bug #1975901 reported by Jose Guedez
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Glance-Simplestreams-Sync Charm
Triaged
Wishlist
Unassigned
simplestreams
New
Undecided
Unassigned

Bug Description

Currently the charm leads to images with names like these:

$ openstack image list -cName -fvalue | grep sync
auto-sync/ubuntu-bionic-18.04-amd64-server-20220523-disk1.img
auto-sync/ubuntu-focal-20.04-amd64-server-20220505-disk1.img
auto-sync/ubuntu-trusty-14.04-amd64-server-20191107-disk1.img
auto-sync/ubuntu-xenial-16.04-amd64-server-20211001-disk1.img

While it is possible to manipulate the prefix ("auto-sync"), the final names are not very end-user friendly.

The image metadata that the charm creates does contain a series of fields that could be used to generate a user "friendly" name:

$ openstack image show 366bc778-fe93-40b5-b450-47d59a20b5b3 -cproperties -fjson|jq -r '.properties.simplestreams_metadata'|jq .
{
  "aliases": "18.04,b,bionic",
  "arch": "amd64",
  "ftype": "disk1.img",
  "label": "release",
  "md5": "43cd09be7fb9d8d7bc1a88d6477b25c2",
  "os": "ubuntu",
  "pubname": "ubuntu-bionic-18.04-amd64-server-20220523",
  "release": "bionic",
  "release_codename": "Bionic Beaver",
  "release_title": "18.04 LTS",
  "sha256": "ab91b16abb155321530d8ca645ead67b6890a678da3c08456af40c72eb20a8ca",
  "size": "387776512",
  "support_eol": "2023-04-26",
  "supported": "True",
  "version": "18.04"
}

This could be used to generate a name like "Ubuntu 20.04 LTS" by combining the "os" and "release_title" fields instead of what seems like hardcoding "pubname". It would even be usefult to just add a configuration to have "template" so this can be tailored for each cloud. No information would be lost as the details remain in the image metadata.

Changed in charm-glance-simplestreams-sync:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Nobuto Murata (nobuto) wrote :

> auto-sync/ubuntu-bionic-18.04-amd64-server-20220523-disk1.img

This is a combination of:
1. charm's prefix ("auto-sync/")
2. pubname ("ubuntu-bionic-18.04-amd64-server-20220523")
3. item_name with "-" prefix if the pubname doesn't end with item_name ("-disk1.img)

2. & 3. are from simplestreams instead of the charm.

https://cloud-images.ubuntu.com/releases/streams/v1/com.ubuntu.cloud:released:download.json

Revision history for this message
Nobuto Murata (nobuto) wrote :

https://git.launchpad.net/simplestreams/tree/simplestreams/mirrors/glance.py?id=18c7d6300a31305978f3871333ba8990262f4bef#n458

By following the naming convention in the title of https://cloud-images.ubuntu.com/releases/focal/release/, a friendly name can be:
"Ubuntu 20.04 LTS (Focal Fossa) <arch> <date>" or something like that.

so
"{os} {release_title} ({release_codename}) {arch}"
-> ubuntu 20.04 LTS (Focal Fossa) amd64

However, there is no capital "U" for Ubuntu and there is no dedicated field for the date. Missing date may not be critical but it's confusing to have multiple images with the same name when `--max` is specified with more than 1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.