Juju Charm - Swift proxy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Edward Hope-Morley cc280d9dcb Add S3 SigV4 location support 1 month ago
actions Convert charm to Python 3 only 1 year ago
charmhelpers stein: Add swift 2.21.0 1 month ago
hooks Replicas per ring 3 weeks ago
lib Add S3 SigV4 location support 2 weeks ago
scripts - removed health checks 6 years ago
swift_manager Convert charm to Python 3 only 1 year ago
templates Add S3 SigV4 location support 2 weeks ago
tests Enable bionic/stein and disco/stein functional tests 1 month ago
unit_tests Add S3 SigV4 location support 2 weeks ago
.gitignore Resync charmhelpers for Stein Swift versions 2 months ago
.gitreview OpenDev Migration Patch 1 month ago
.project Fixup missing files 6 years ago
.pydevproject Enable xenial/queens amulet tests 1 year ago
.stestr.conf Convert charm to Python 3 only 1 year ago
.zuul.yaml Added tox environment for gathering coverage 2 months ago
LICENSE Re-license charm as Apache-2.0 2 years ago
Makefile Tests dir no longer need copy of charmhelpers 7 months ago
README.Swift_ring_management Refactor of ring management code 3 years ago
README.md Improve support for telemetry collection 1 year ago
actions.yaml Add an action to report utilization 1 year ago
charm-helpers-hooks.yaml Update charm-helpers-hooks.yaml and sync ch 3 months ago
config.yaml Replicas per ring 3 weeks ago
copyright Re-license charm as Apache-2.0 2 years ago
hardening.yaml Add hardening support 3 years ago
icon.svg Update charm icon 1 year ago
metadata.yaml Update series metadata 1 month ago
requirements.txt Update requirements 7 months ago
revision Add config options for proxy-server.conf template. node-timeout and recoverable-node-timeout. For large swift/glance uploads, higher defaults are needed to prevent uploads from failing on real servers which are slower than VMs. 5 years ago
setup.cfg Add project infomation into setup.cfg 4 months ago
test-requirements.txt Replace ostestr with stestr in testing framework. 2 months ago
tox.ini Replace ostestr with stestr in testing framework. 2 months ago



This charm provides the swift-proxy component of the OpenStack Swift object storage system. It can be deployed as part of its own stand-alone storage cluster or it can be integrated with the other OpenStack components, assuming those are also managed by Juju. For Swift to function, you’ll also need to deploy additional swift-storage nodes using the cs:precise/swift-storage charm.

For more information about Swift and its architecture, visit the official project website

This charm was developed to support deploying multiple version of Swift on Ubuntu Precise 12.04, as they relate to the release series of OpenStack. That is, OpenStack Essex corresponds to Swift 1.4.8 while OpenStack Folsom shipped 1.7.4. This charm can be used to deploy either (and future) versions of Swift onto an Ubuntu Precise 12.04 or Trusty 14.04 making use of the Ubuntu Cloud Archive when needed.


Currently, Swift may be deployed in two ways. In either case, additional storage nodes are required. The configuration option that dictates how to deploy this charm is the ‘zone-assignment’ setting. This section describes how to select the appropriate zone assignment policy, as well as a few other configuration settings of interest. Many of the configuration settings can be left as default.

Zone Assignment

This setting determines how the charm assigns new storage nodes to storage zones.

The default, ‘manual’ option is suggested for production as it allows administrators to carefully architect the storage cluster. It requires each swift-storage service to be deployed with an explicit storage zone configured in its deployment settings. Upon relation to a swift-proxy, the storage node will request membership to its configured zone and be assigned by the swift-proxy charm accordingly. Using the cs:precise/swift-storage charm with this charm, a deployment would look something like:

$ cat >swift.cfg <<END
        zone-assignment: manual
        replicas: 3
        zone: 1
        block-device: /etc/swift/storage.img|2G
        zone: 2
        block-device: /etc/swift/storage.img|2G
        zone: 3
        block-device: /etc/swift/storage.img|2G
$ juju deploy --config=swift.cfg swift-proxy
$ juju deploy --config=swift.cfg swift-storage swift-storage-zone1
$ juju deploy --config=swift.cfg swift-storage swift-storage-zone2
$ juju deploy --config=swift.cfg swift-storage swift-storage-zone3
$ juju add-relation swift-proxy swift-storage-zone1
$ juju add-relation swift-proxy swift-storage-zone2
$ juju add-relation swift-proxy swift-storage-zone3

This will result in a configured storage cluster of 3 zones, each with one node. To expand capacity of the storage system, nodes can be added to specific zones in the ring.

$ juju add-unit swift-storage-zone1
$ juju add-unit -n5 swift-storage-zone3    # Adds 5 units to zone3

This charm will not balance the storage ring until there are enough storage zones to meet its minimum replica requirement, in this case 3.

The other option for zone assignment is ‘auto’. In this mode, swift-proxy gets a relation to a single swift-storage service unit. Each machine unit assigned to that service unit will be distributed evenly across zones.

$ cat >swift.cfg <<END
    zone-assignment: auto
    replicas: 3
    zone: 1
    block-device: /etc/swift/storage.img|2G
$ juju deploy --config=swift.cfg swift-proxy
$ juju deploy --config=swift.cfg swift-storage
$ juju add-relation swift-proxy swift-storage
# The swift-storage/0 unit ends up the first node in zone 1
$ juju add-unit swift-storage
# swift-storage/1 ends up the first node in zone 2.
$ juju add-unit swift-storage
# swift-storage/2 is the first in zone 3, replica requirement is satisfied
# the ring is balanced.

Extending the ring in the case is just a matter of adding more units to the single service unit. New units will be distributed across the existing zones.

$ juju add-unit swift-storage
# swift-storage/3 is assigned to zone 1.
$ juju add-unit swift-storage
# swift-storage/4 is assigned to zone 2.

Installation repository.

The ‘openstack-origin’ setting allows Swift to be installed from installation repositories and can be used to setup access to the Ubuntu Cloud Archive to support installing Swift versions more recent than what is shipped with Ubuntu 12.04 (1.4.8). For more information, see config.yaml.


By default, the charm will be deployed using the tempauth auth system. This is a simple and not-recommended auth system that functions without any external dependencies. See Swift documentation for details.

The charm may also be configured to use Keystone, either manually (via config) or automatically via a relation to an existing Keystone service using the cs:precise/keystone charm. The latter is preferred, however, if a Keystone service is desired but it is not managed by Juju, the configuration for the auth token middleware can be set manually via the charm’s config. A relation to a Keystone server via the identity-service interface will configure swift-proxy with the appropriate credentials to make use of Keystone and is required for any integration with other OpenStack components.


Swift may be used to as a storage backend for the Glance image service. To do so, simply add a relation between swift-proxy and an existing Glance service deployed using the cs:precise/glance charm.


There are two mutually exclusive high availability options: using virtual IP(s) or DNS. In both cases, a relationship to hacluster is required which provides the corosync back end HA functionality.

To use virtual IP(s) the clustered nodes must be on the same subnet such that the VIP is a valid IP on the subnet for one of the node’s interfaces and each node has an interface in said subnet. The VIP becomes a highly-available API endpoint.

At a minimum, the config option ‘vip’ must be set in order to use virtual IP HA. If multiple networks are being used, a VIP should be provided for each network, separated by spaces. Optionally, vip_iface or vip_cidr may be specified.

To use DNS high availability there are several prerequisites. However, DNS HA does not require the clustered nodes to be on the same subnet. Currently the DNS HA feature is only available for MAAS 2.0 or greater environments. MAAS 2.0 requires Juju 2.0 or greater. The clustered nodes must have static or “reserved” IP addresses registered in MAAS. The DNS hostname(s) must be pre-registered in MAAS before use with DNS HA.

At a minimum, the config option ‘dns-ha’ must be set to true and at least one of ‘os-public-hostname’, ‘os-internal-hostname’ or ‘os-internal-hostname’ must be set in order to use DNS HA. One or more of the above hostnames may be set.

The charm will throw an exception in the following circumstances: If neither ‘vip’ nor ‘dns-ha’ is set and the charm is related to hacluster If both ‘vip’ and ‘dns-ha’ are set as they are mutually exclusive If ‘dns-ha’ is set and none of the os-{admin,internal,public}-hostname(s) are set

Network Space support

This charm supports the use of Juju Network Spaces, allowing the charm to be bound to network space configurations managed directly by Juju. This is only supported with Juju 2.0 and above.

API endpoints can be bound to distinct network spaces supporting the network separation of public, internal and admin endpoints.

To use this feature, use the --bind option when deploying the charm:

juju deploy swift-proxy --bind "public=public-space internal=internal-space admin=admin-space"

alternatively these can also be provided as part of a juju native bundle configuration:

  charm: cs:xenial/swift-proxy
  num_units: 1
    public: public-space
    admin: admin-space
    internal: internal-space

NOTE: Spaces must be configured in the underlying provider prior to attempting to use them.

NOTE: Existing deployments using os-*-network configuration options will continue to function; these options are preferred over any network space binding provided if set.

Telemetry support

For OpenStack releases >= Mitaka, improved telemetry collection support is possible by adding a relation between swift-proxy and rabbitmq-server:

juju add-relation swift-proxy rabbitmq-server

NOTE: In a busy Swift deployment this can place additional load on the underlying message bus.