glance simplestreams sync #34

Supports: xenial bionic focal groovy
Add to new model

Description

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


Overview

The glance-simplestreams-sync charm keeps OpenStack cloud images (in Glance) synchronised with the latest available images from a Simplestreams mirror(s). It uses Cron to do this.

The charm places simplestreams metadata in Object storage for future use by Juju. It then publishes the URL for that metadata as the endpoints of a new OpenStack service called 'product-streams'.

The charm installs Simplestreams from a snap.

Usage

Configuration

This section covers common and/or important configuration options. See file config.yaml for the full list of options, along with their descriptions and default values. See the Juju documentation for details on configuring applications.

run

The run option enables the synchronisation cron script. This option accepts Boolean values ('true' or 'false') with the default value being 'false'. Changing the value from 'false' to 'true' will immediately schedule an image sync.

Note: Enabling this option at cloud deploy time may cause a race condition with the set up of a possible storage backend for Glance.

frequency

The frequency option controls how often the sync cron job is run. It is used to link the cron script into /etc/cron.<frequency>. Valid string values are: 'hourly', 'daily', and 'weekly'. The default is 'daily'.

region

The region option states the OpenStack region to operate in. The default value is 'RegionOne'.

mirror_list

The mirror_list option is a YAML-formatted list of Simplestreams mirrors and their configuration properties. The default behaviour is to download images from https://cloud-images.ubuntu.com.

ssl_ca

The ssl_ca option verifies (optionally) the certificates when in SSL mode for Keystone and Glance. This should be provided as a base64 encoded PEM certificate.

Deployment

To deploy to an existing OpenStack cloud (that already includes Glance, Object storage, and Keystone):

juju deploy glance-simplestreams-sync
juju add-relation glance-simplestreams-sync:identity-service keystone:identity-service

Note: Charmed OpenStack commonly employs Ceph-backed Object storage (see the ceph-radosgw charm). Otherwise, a vanilla Swift-based solution can be used (see the swift-proxy charm).

Actions

Juju actions allow specific operations to be performed on a per-unit basis. This charm supports the single action sync-images, which allows for a one-time image sync from the currently configured mirror list.

Bugs

Please report bugs on Launchpad.

For general charm questions refer to the OpenStack Charm Guide.


Configuration

cloud_name
(string) Cloud name to be used in simplestreams index file
glance-simplestreams-sync-openstack
content_id_template
(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.
auto.sync
custom_properties
(string) Space separated list of custom properties (format key=value) to be set in glance for all synced images e.g. hw_firmware_type, hw_vif_multiqueue_enabled.
frequency
(string) cron job frequency - one of ['hourly', 'daily', 'weekly']
daily
hypervisor_mapping
(boolean) Enable configuration of hypervisor-type on synced images. . This is useful in multi-hypervisor clouds supporting both LXD and KVM.
key
(string) DEPRECATED - option no longer used and will be removed
mirror_list
(string) YAML-formatted list of simplestreams mirrors and their configuration properties. Defaults to downloading the released images from cloud-images.ubuntu.com.
[{url: 'http://cloud-images.ubuntu.com/releases/', name_prefix: 'ubuntu:released', path: 'streams/v1/index.sjson', max: 1, item_filters: ['release~(trusty|xenial|bionic|focal)', 'arch~(x86_64|amd64)', 'ftype~(disk1.img|disk.img)']}]
nagios_context
(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.
juju
nagios_servicegroups
(string) A comma-separated list of nagios servicegroups. If left empty, the nagios_context will be used as the servicegroup
name_prefix
(string) This is prefixed to the object name when uploading to glance.
auto-sync/
region
(string) OpenStack region to operate in.
RegionOne
run
(boolean) Enable cron-based synchronisation
snap-channel
(string) Snap channel to install simplestreams snap from
stable
source
(string) DEPRECATED - option no longer used and will be removed
ssl_ca
(string) base64-encoded SSL CA to use to verify certificates from keystone and glance if using SSL on the services.
use_swift
(boolean) DEPRECATED FOR REMOVAL Should the charm set up the product-streams endpoint with swift's URLs? If this value is set to False, product-streams metadata will be hosted on a local Apache server running on the unit and endpoints will be registered referencing the local unit. This does not support HA or TLS and is for testing purposes only.
True
user_agent
(string) User agent to use when requesting images from image servers listed in the mirror_list.
glance-simplestreams-sync