when base-image-path is set juju looks for the image name in the simplestreams

Bug #1829440 reported by Felipe Reyes
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

with the patch to fix bug 1814633 a new config option is available: base-image-path, for example:

juju model-config base-image-path="projects/some-project/global/images/"

Now when juju deploys will look for the image in projects/some-project/global/images/ubuntu-1804-bionic-v20190514 being "ubuntu-1804-bionic-v20190514" the name referenced by spec.Image.id which comes ultimately from the simplestreams index, it's very hard for a user of this feature to come up with their own automation to read simplestreams index detect changes and generate new images with the names that juju will look for under their own project.

juju could look for image names like "ubuntu-$SERIES" and base-image-path could be set to "projects/some-project/global/images/" or "projects/some-project/global/images/my-own-prefix-", this will make juju to look for the image "projects/some-project/global/images/ubuntu-bionic" or "projects/some-project/global/images/my-own-prefix-ubuntu-bionic" allowing different images to live in the same project. And when they want to rollout a new version of their customer image they just set a new base-image-path (e.g. "projects/some-project/global/images/my-own-prefix-2-"

Felipe Reyes (freyes)
tags: added: atos gce-provider sts
Revision history for this message
Ian Booth (wallyworld) wrote :

It's not sufficient just to look for an image using ubuntu-$SERIES since the image used also depends on region, arch as well as potentially virtualisation type etc. Simplestreams handles all of this complexity.

There's a feature flag "image-metadata" that can be turned on to allow the user to specify custom
image ids for a given region, series, arch. eg

$ juju metadata add-image --series bionic --region us-central-1 1234

where 1234 is the image id. You can then list and delete image ids etc. See juju help metadata.

$ juju metadata list-images
Source Series Arch Region Image id Stream Virt Type Storage Type
custom bionic amd64 localhost 1234 released

Such custom image metadata is cached in the controller and used in preference to simplestreams metadata.

To use the feature, you need to set the feature flag prior to bootstrap, eg

$ export JUJU_DEV_FEATURE_FLAGS=image-metadata
$ juju bootstrap ....

The feature flag needs to be set on any client machine to activate the metadata add/list/delete commands.

If you already have a bootstrapped controller, you can manually set the feature flag by:

- ssh into the controller
- edit the /lib/systemd/system/jujud-machine-0/jujud-machine-0.service file and ensure the ENVIRONMENT is set
...
[Service]
Environment="JUJU_DEV_FEATURE_FLAGS=image-metadata"
...
- restart the controller service

We should enhance juju to record which machines have been started with custom images (probably in the instanceData doc) and somehow surface this info also.

John A Meinel (jameinel)
Changed in juju:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Medium → Low
tags: added: expirebugs-bot
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.