Chapter 9. Customizing the Object Storage service (swift)


You can customize some of the default settings of the Object Storage service (swift) to optimize deployment performance.

9.1. Prerequisites

  • You have the oc command line tool installed on your workstation.
  • You are logged on to a workstation that has access to the RHOSO control plane as a user with cluster-admin privileges.

You can customize the following options for your Object Storage service (swift) deployment in the OpenStackControlPlane CR:

Expand
Table 9.1. OpenStackControlPlane CR options
OptionDescription

swiftProxy/ceilometerEnabled

Enables the Ceilometer middleware in the proxy server.

swiftProxy/encryptionEnabled

Enables object encryption by using the Key Manager service (barbican).

swiftRing/minPartHours

Sets the minimum time in hours before a partition in a ring can be moved following a rebalance.

swiftRing/partPower

Sets the partition power to use when building Object Storage rings.

swiftRing/ringReplicas

Sets the number of object replicas to use in the Object Storage rings.

You can customize the following configuration files for Object Storage services by using the defaultConfigOverwrite parameter and keys in the OpenStackControlPlane CR:

Expand
Table 9.2. Configuration file options
ServiceKey

account-server

01-account-server.conf

container-server

01-container-server.conf

object-server

01-object-server.conf

object-expirer

01-object-expirer.conf

proxy-server

01-proxy-server.conf

Procedure

  1. Open your OpenStackControlPlane CR file, openstack_control_plane.yaml, and enable Ceilometer middleware and object encryption under the swiftProxy parameter in the swift template:

    apiVersion: core.openstack.org/v1beta1
    kind: OpenStackControlPlane
    metadata:
      name: openstack-control-plane
      namespace: openstack
    spec:
      ...
      swift:
        enabled: true
        template:
          swiftProxy:
            ceilometerEnabled: true
            encryptionEnabled: true
            replicas: 2
    ...
    Copy to Clipboard Toggle word wrap
  2. Add values for minPartHours, partPower, and ringReplicas under the swiftRing parameter:

    ...
    spec:
      ...
      swift:
        enabled: true
        template:
          swiftProxy:
            ...
          swiftRing:
            minPartHours: <number_of_hours>
            partPower: <partition_power>
            ringReplicas: <number_of_copies>
    ...
    Copy to Clipboard Toggle word wrap
    • Replace <number_of_hours> with the minimum time in hours before you want a partition in a ring to be moved following a rebalance.
    • Replace <partition_power> with the partition power you want to use when building Object Storage rings, for example, 12.
    • Replace <number_of_copies> with the number of object copies you want in your cluster.
  3. Change the number of workers in the object-server service by adding the defaultConfigOverwrite parameter under the swiftStorage parameter:

    ...
    spec:
      ...
      swift:
        enabled: true
        template:
          swiftProxy:
            ...
          swiftRing:
            ...
          swiftStorage:
            replicas: 3
            storageClass: local-storage
            storageRequest: 10Gi
            defaultConfigOverwrite:
              01-object-server.conf: |
                [DEFAULT]
                workers = <number_of_workers>
    Copy to Clipboard Toggle word wrap
    • Replace <number_of_workers> with the number of workers you want in the object-server service.
  4. Update the control plane:

    $ oc apply -f openstack_control_plane.yaml -n openstack
    Copy to Clipboard Toggle word wrap
  5. Wait until RHOCP creates the resources related to the OpenStackControlPlane CR. Run the following command to check the status:

    $ oc get openstackcontrolplane -n openstack
    Copy to Clipboard Toggle word wrap

    The OpenStackControlPlane resources are created when the status is "Setup complete".

    Tip

    Append the -w option to the end of the get command to track deployment progress.

When you have deployed the Object Storage service (swift) on external data plane nodes, you can customize the default service configuration by including additional ConfigMap or Secret CRs in your OpenStackDataPlaneService CR. You then add the custom service name to your OpenStackDataPlaneNodeSet CR.

The default service configuration is as follows:

apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
  name: <swift-customized>
spec:
  playbook: osp.edpm.swift
  dataSources:
    - secretRef:
        name: swift-conf
    - configMapRef:
        name: swift-storage-config-data
    - configMapRef:
        name: swift-ring-files
  edpmServiceType: swift
Copy to Clipboard Toggle word wrap

When you create a custom service, use a custom service name, for example, swift-customized, and add the custom service name to the list of services in your OpenStackDataPlaneNodeSet CR. For more information about creating a custom service, see Creating and enabling a custom service in Customizing the Red Hat OpenStack Services on OpenShift deployment.

You can also customize the Object Storage service by applying different configurations to different node sets. For example, if you have two different types of nodes with different performance characteristics, you can use different configuration files with specific settings for each node set. For more information about customizing node sets, see Configuring a node set for a feature or workload in Customizing the Red Hat OpenStack Services on OpenShift deployment.

9.4. Custom rings

You can create custom rings to update existing Object Storage service (swift) clusters.

When you add new nodes to a cluster, their characteristics might differ from those of the original nodes. Without custom adjustments, the larger capacity of the new nodes may be underused, or if weights change in the rings, data dispersion can become uneven, which reduces safety.

The ring builder helps manage Object Storage as clusters grow and technologies evolve. For assistance with creating custom rings, contact Red Hat Support.

The Object Storage service (swift) runs many processes in the background to ensure long-term data availability, durability, and persistence. For example:

  • Auditors constantly re-read database and object files and compare them by using checksums to make sure there is no silent bit-rot. Any database or object file that no longer matches its checksum is quarantined and becomes unreadable on that node. The replicators then copy one of the other replicas to make the local copy available again.
  • Objects and files can disappear when you replace disks or nodes or when objects are quarantined. When this happens, replicators copy missing objects or database files to one of the other nodes.

The Object Storage service includes a tool called swift-recon that collects data from all nodes and checks the overall cluster health. You can use the swift-recon command line utility to obtain metrics from the account, container, and object servers.

Procedure

  1. Log in to one of the Controller nodes.
  2. Run the following command:

    $ oc debug --keep-labels=true job/swift-ring-rebalance -- /bin/sh -c 'swift-ring-tool get && swift-recon -arqlT --md5'
    Copy to Clipboard Toggle word wrap
    • Optional: Use the --all option to return additional output.

      This command queries all servers on the ring for the following data:

      • Async pendings: If the cluster load is too high and processes cannot update database files fast enough, some updates occur asynchronously. These numbers decrease over time.
      • Replication metrics: Review the replication timestamps; full replication passes happen frequently with few errors. An old entry, for example, an entry with a timestamp from six months ago, indicates that replication on the node has not completed in the last six months.
      • Ring md5sums: This ensures that all ring files are consistent on all nodes.
      • swift.conf md5sums: This ensures that all configuration files are consistent on all nodes.
      • Quarantined files: There must be no, or very few, quarantined files for all nodes.
      • Time-sync: All nodes must be synchronized.
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top