glance simplestreams sync #0

Supports: wily


Automatically keep your glance mirror in sync with any (multiple) source(s) of simplestreams data.


This charm provides a service that syncs your OpenStack cloud's available OS images in OpenStack Glance with the available images from a set of simplestreams mirrors, by default using

It will create a user named 'image-stream' in the 'services' tenant. If swift is enabled, glance will store its images in swift using the image-stream username.

It can optionally also store simplestreams metadata into Swift for future use by juju. If enabled, it publishes the URL for that metadata as the endpoints of a new OpenStack service called 'product-streams'. If using Swift is not enabled, the product-streams service will still exist, but nothing will respond to requests to its endpoints.

The charm installs a cron job that repeatedly checks the status of related services and begins syncing image data from your configured mirrors as soon as all services are in place.

It can be deployed at any time, and upon deploy (or changing the 'run' config setting), it will attempt to contact keystone and glance and start a sync every minute until a successful sync occurs.


This charm requires a juju relation to Keystone. It also requires a running Glance instance, but not a relation - it connects with glance via its endpoint as published in Keystone.


juju deploy glance-simplestreams-sync [--config optional-config.yaml]
juju add-relation keystone glance-simplestreams-sync


The charm has the following configuration variables:


run is a boolean that enables or disables the sync cron script. It is True by default, and changing it from False to True will schedule an immediate attempt to sync images.


use_swift is a boolean that determines whether or not to store data in swift and publish the path to product metadata via the 'product-streams' endpoint.

NOTE Changing the value will only affect the next sync, and does not currently remove an existing product-streams service or delete potentially stale product data.


frequency is a string, and must be one of 'hourly', 'daily', 'weekly'. It controls how often the sync cron job is run - it is used to link the script into /etc/cron.$frequency.


region is the OpenStack region in which the product-streams endpoint will be created.


mirror_list is a yaml-formatted list of options to be passed to Simplestreams. It defaults to settings for downloading images from, and is not yet tested with other mirror locations. If you have set up your own Simplestreams mirror, you should be able to set the necessary configuration values.


The glance-simplestreams sync charm is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The charm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this charm. If not, see


(string) Cloud name to be used in simplestreams index file
(string) A Python-style .format() template to use when generating content_id properties for images uploaded to glance. The content_id is considered when matching images between the source and destination to decide which images to mirror. By varying this value you can mirror disjoint sets of images from the same source into a single glance, either by using multiple deployments of this charm, or by using a tool such as sstream-mirror-glance, and they will not interfere with each other. Here is a more interesting example value: com.example.customstack.{region}:ubuntu:celery-worker Currently the only available substitution is "region". Any other attempted substitutions will break the sync script.
(string) cron job frequency - one of ['hourly', 'daily', 'weekly']
(string) YAML-formatted list of simplestreams mirrors and their configuration properties. Defaults to downloading the released images from
[{url: '', name_prefix: 'ubuntu:released', path: 'streams/v1/index.sjson', max: 1, item_filters: ['release=trusty', 'arch~(x86_64|amd64)', 'ftype~(disk1.img|disk.img)']}]
(string) Used by the nrpe-external-master subordinate charm. A string that will be prepended to instance name to set the host name in nagios. So for instance the hostname would be something like: juju-myservice-0 If you're running multiple environments with the same services in them this allows you to differentiate between them.
(string) A comma-separated list of nagios servicegroups. If left empty, the nagios_context will be used as the servicegroup
(string) This is prefixed to the object name when uploading to glance.
(string) Username to request access on rabbitmq-server.
(string) RabbitMQ virtual host to request access on rabbitmq-server.
(string) Openstack region to operate in.
(boolean) Should the sync be running or not?
(boolean) Should the charm set up the product-streams endpoint with swift's URLs?