---
title: Charmhub | Deploy Swift Storage using Charmhub - The Open Operator Collection
description: Deploy the latest version of Swift Storage on any cloud. OpenStack Object
  Storage - Swift storage service
url: https://charmhub.io/swift-storage
---

# Swift Storage

[OpenStack Charmers](https://charmhub.io/publisher/openstack-charmers "View all packages from OpenStack Charmers")

* [OpenStack Charmers](https://charmhub.io/publisher/openstack-charmers "View all packages from OpenStack Charmers")
* [Cloud](https://charmhub.io/?filter=cloud)
* [Storage](https://charmhub.io/?filter=storage)

Platform:

24.04

23.10

23.04

22.10

22.04

20.04

18.04

14.04

12.04

yoga/stable 518

```
juju deploy swift-storage --channel yoga/stable
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Relevant links

* [Homepage](https://opendev.org/openstack/charm-swift-storage)

---

#### Contacts

* [Submit a bug](https://bugs.launchpad.net/charm-swift-storage/+filebug)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# Overview

OpenStack [Swift](https://docs.openstack.org/developer/swift) is a highly available, distributed, eventually consistent object/blob store.

The swift-storage charm deploys Swift’s storage component. The charm’s basic function is to initialise storage devices and manage the container, object, and account services. It works in tandem with the [swift-proxy](https://jaas.ai/swift-proxy) charm, which is used to add proxy nodes.

**Important:** This documentation supports version `3.x` of the Juju client.
See the [OpenStack Charm
guide](https://docs.openstack.org/charm-guide/latest/project/support-notes.html#breaking-changes-between-juju-2-9-x-and-3-x) if you are using the `2.9.x` client.

# Usage

## Configuration

This section covers common configuration options. See file `config.yaml` for the full list of options, along with their descriptions and default values.

### `zone`

The `zone` option assigns a storage zone (an integer) to a storage node. A zone is associated with data replicas.

### `block-device`

The `block-device` option specifies the device(s) that will be used on all machines associated with the application. Value types include:

* an actual block device (e.g. ‘sdb’ or ‘/dev/sdb’). A space-separated list is used for multiple devices.
* a path to a local file with the size appended after a pipe (e.g. ‘/etc/swift/storagedev1.img|5G’). The file will be created if necessary and be mapped to a loopback device. This is intended for development and testing purposes.

The resulting block device(s) will be XFS-formatted and use `/srv/node/<device-name>` as a mount point.

### `storage-region`

The `storage-region` option specifies a storage region (an integer). It is used only for multi-region (global) clusters.

## Deployment

Let file `swift.yaml` contain the deployment configuration:

```
    swift-proxy:
        zone-assignment: manual
        replicas: 3
    swift-storage-zone1:
        zone: 1
        block-device: /dev/sdb
    swift-storage-zone2:
        zone: 2
        block-device: /dev/sdb
    swift-storage-zone3:
        zone: 3
        block-device: /dev/sdb
```

Deploy the proxy and storage nodes:

```
juju deploy --config swift.yaml swift-proxy
juju deploy --config swift.yaml swift-storage swift-storage-zone1
juju deploy --config swift.yaml swift-storage swift-storage-zone2
juju deploy --config swift.yaml swift-storage swift-storage-zone3
```

Add relations between the proxy node and all storage nodes:

```
juju integrate swift-proxy:swift-storage swift-storage-zone1:swift-storage
juju integrate swift-proxy:swift-storage swift-storage-zone2:swift-storage
juju integrate swift-proxy:swift-storage swift-storage-zone3:swift-storage
```

This will result in a three-zone cluster, with each zone consisting of a single storage node, thereby satisfying the replica requirement of three.

Storage capacity is increased by adding swift-storage units to a zone. For example, to add two storage nodes to zone ‘3’:

```
juju add-unit -n 2 swift-storage-zone3
```

> **Note**: When scaling out ensure the candidate machines are equipped with the block devices currently configured for the associated application.

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

Appendix [Swift usage](https://docs.openstack.org/project-deploy-guide/charm-deployment-guide/latest/app-swift.html) in the [OpenStack Charms Deployment Guide](https://docs.openstack.org/project-deploy-guide/charm-deployment-guide) offers in-depth guidance for deploying Swift with charms. In particular, it shows how to set up a multi-region (global) cluster.

## Actions

This section covers Juju [actions](https://jaas.ai/docs/actions) supported by the charm. Actions allow specific operations to be performed on a per-unit basis.

* `openstack-upgrade`
* `pause`
* `resume`

To display action descriptions run `juju actions swift-storage`.

# Bugs

Please report bugs on [Launchpad](https://bugs.launchpad.net/charm-swift-storage/+filebug).

For general charm questions refer to the [OpenStack Charm Guide](https://docs.openstack.org/charm-guide).

---

[Help improve this document in the forum](https://discourse.charmhub.io/t/swift-storage-docs-index/11104) ([guidelines](https://discourse.charmhub.io/t/how-to-write-docs-our-documentation-guidelines-for-contributors/1245)). Last updated 3 years ago.
