g-s-s should provide a "latest" image per series/arch

Bug #1933130 reported by Junien F
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Glance-Simplestreams-Sync Charm
Fix Committed
Wishlist
Gui Maluf Balzana

Bug Description

Hi,

When creating openstack VMs using the command line, you have to specify the image you want to use. g-s-s adds a date to the image name, so you always have to recheck which is the current image.

It would be nice if for example, it could maintain a "latest" image per serie/arch, for example for bionic+focal and amd64+arm64 :

auto-sync/ubuntu-focal-20.04-amd64-server-latest-disk1.img
auto-sync/ubuntu-bionic-20.04-amd64-server-latest-disk1.img
auto-sync/ubuntu-focal-20.04-arm64-server-latest-disk1.img
auto-sync/ubuntu-bionic-20.04-arm64-server-latest-disk1.img

Then we'd be able to always use the same image name to get a working, up-to-date image.

Thanks

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

This is a nice idea. Triaged to wishlist.

Changed in charm-glance-simplestreams-sync:
importance: Undecided → Wishlist
status: New → Triaged
tags: added: good-first-bug
Changed in charm-glance-simplestreams-sync:
assignee: nobody → Sudeep Bhandari (sudeephb)
Changed in charm-glance-simplestreams-sync:
assignee: Sudeep Bhandari (sudeephb) → nobody
Changed in charm-glance-simplestreams-sync:
assignee: nobody → Gui Maluf Balzana (guimalufb)
Revision history for this message
Gui Maluf Balzana (guimalufb) wrote :

Hi @axino,

I've discussed with @wolsen and @freyes about this request. It was suggested that instead of changing the name of the image we could add a `latest=true` attribute to the most recent image. That way you could get the latest image using glance filter API.

From the command line would be something link

```
openstack image list --property os_version=22.04 --property latest=true

openstack server create --image-property os_version=22.04 --image-property latest=true ...
```

would that cover your use case?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-glance-simplestreams-sync (master)
Changed in charm-glance-simplestreams-sync:
status: Triaged → In Progress
Revision history for this message
Junien F (axino) wrote :

"would that cover your use case?" I think it would yes - thanks !

Revision history for this message
Erlon R. Cruz (sombrafam) wrote :

@guimalufb, regarding the image name, was there any drawbacks related to changing the image name? Using a property instead of the name will shadow the feature and this will not be visible and used for most of the users.

Revision history for this message
Gui Maluf Balzana (guimalufb) wrote :

hi @sombrafam, thanks for you review.

adding the "latest" stamp over the image's name was my first thought to implement the feature.

however, the main drawback on that approach is to rely on a fragile attribute of the image. for instance, the image name can be changed through g-s-s and simplestreams `name_prefix` config and `--name-prefix` parameter, respectively.

also, simplestreams already uses and correctly sets image's properties. hence is easier to manipulate properties than, for instance, rename it and remember what it was named as before.

I strongly agree the feature would be more visible if it were stamped on the image name. to cover that I little bit I will improve the documentation on g-s-s and simplestreams.

Revision history for this message
Erlon R. Cruz (sombrafam) wrote :

Hi @guimalufb,

Thanks for the explanation. I understand your point, though I think we could think about other ways to make renaming of the image reliable and get the feature pronounced. But, I see that the simplestream change has already merged, so, this is something we can discuss in the future. Additionally to adding the documentation, can you also create a bug/feature request on simplestreams to allow it to keep the latest string on the name? I know it looks like the same request as in the first bug (this), but this one would be contained in simplestreams, that could take the same parameter '--set-latest-property', but that would also name the image correctly.

Regarding the way that could be done in gss, one possible way is that at image creation, the name of the image could also be added in as a property, so, when the new latest is uploaded, would be just a matter of fetching the old latest and renaming it to that stored name. But that will be fun for another onboarder :)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-glance-simplestreams-sync (master)

Reviewed: https://review.opendev.org/c/openstack/charm-glance-simplestreams-sync/+/852445
Committed: https://opendev.org/openstack/charm-glance-simplestreams-sync/commit/4754aca4209d1d18854b05360953bd5ba33cd668
Submitter: "Zuul (22348)"
Branch: master

commit 4754aca4209d1d18854b05360953bd5ba33cd668
Author: Guilherme Maluf Balzana <email address hidden>
Date: Wed Jul 27 17:40:21 2022 +0200

    Add set_latest_property config to new image

    When creating Openstack VMs the user has to specify the image it wants
    to use. sstream-mirror-glance adds a date to the image name, so they
    always have to recheck which is the current latest image.

    This commit adds the `set_latest_property` configuration to include
    --set-latest-property to sstream-mirror-glance command line argument.

    When --set-latest-property is given sstream-mirror-glance will set the
    recently synced image with the `latest=true` property and then remove
    the `latest` property from all the os_version/architecture matching
    images.

    Configure bundles to fetch simplestreams snap from edge channel

    Closes-bug: #1933130
    Change-Id: Idf78294db7abb8c81d637086e8142782bf1dd36f
    Func-Test-PR: https://github.com/openstack-charmers/zaza-openstack-tests/pull/853

Changed in charm-glance-simplestreams-sync:
status: In Progress → Fix Committed
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.