Comment 1 for bug 1829440

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.