9.6. Scaling Object Storage service capacity on OpenShift nodes


Increase your Object Storage service (swift) cluster capacity to meet growing storage demands by adding PersistentVolumes (PVs) on OpenShift nodes through the swiftStorage replicas setting.

Limitations
  • Do not resize existing PersistentVolumes. Resizing requires manual intervention at multiple layers (PV, logical volume, and file system) and can cause synchronization issues or data loss. Always scale by adding new replicas instead.

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.
  • Your storage class has sufficient capacity to provision additional PersistentVolumes.
  • You have verified that no recent ring rebalance is in progress. For more information, see Rebalancing Object Storage rings.

Procedure

  1. Update the OpenStackControlPlane CR to increase the swiftStorage replicas to the required count:

    $ oc patch openstackcontrolplane $(oc get oscp -n openstack -o custom-columns=NAME:.metadata.name --no-headers) -n openstack --type=merge -p '{"spec": {"swift": {"template": {"swiftStorage": {"replicas": <required_count>}}}}}'
    • Replace <required_count> with the total number of storage replicas you want. For example, to scale from 3 to 5 replicas, set <required_count> to 5.
  2. Verify that new PVCs are created and successfully bound to the storage class:

    $ oc get pvc -n openstack -l service=swift

    Example output

    NAME                     STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS     AGE
    swift-swift-storage-0    Bound    pvc-3c7d003e-529c-47c0-ae97-5c6159003a2f   100Gi      RWO            swift-storage    10d
    swift-swift-storage-1    Bound    pvc-8f2a1b9c-6d4e-11ec-90d6-0242ac120003   100Gi      RWO            swift-storage    10d
    swift-swift-storage-2    Bound    pvc-a3c4d5e6-6d4e-11ec-90d6-0242ac120003   100Gi      RWO            swift-storage    10d
    swift-swift-storage-3    Bound    pvc-b7e8f9a0-6d4e-11ec-90d6-0242ac120003   100Gi      RWO            swift-storage    1m
    swift-swift-storage-4    Bound    pvc-c9f0a1b2-6d4e-11ec-90d6-0242ac120003   100Gi      RWO            swift-storage    1m

    All PVCs must show a STATUS of Bound.

  3. Verify that all swift-storage pods are created and in Running state:

    $ oc get pods -n openstack -l service=swift

    Example output

    NAME                      READY   STATUS    RESTARTS   AGE
    swift-proxy-0             3/3     Running   0          10d
    swift-proxy-1             3/3     Running   0          10d
    swift-storage-0           4/4     Running   0          10d
    swift-storage-1           4/4     Running   0          10d
    swift-storage-2           4/4     Running   0          10d
    swift-storage-3           4/4     Running   0          2m
    swift-storage-4           4/4     Running   0          2m

    All pods must show STATUS: Running with all containers ready.

  4. Wait for the automatic ring rebalance to complete:

    $ oc get job -n openstack -l job-name=swift-ring-rebalance

    Example output

    NAME                   COMPLETIONS   DURATION   AGE
    swift-ring-rebalance   1/1           45s        3m

    The job is complete when COMPLETIONS shows 1/1.

    注意

    The swift-operator automatically triggers a ring rebalance when you add storage devices. However, the rebalance respects the minPartHours interval (default: 24 hours). If multiple rebalances occur within this 24-hour window, the operator does not wait for the interval to pass. Instead, it triggers the rebalance immediately, but not all data replicas move to the new devices. In this scenario, manual rebalancing is required after verifying 100% replica coverage. For more information, see Rebalancing Object Storage rings.

  5. Verify that the Object Storage cluster recognizes the updated capacity:

    $ oc rsh -c proxy-server $(oc get pods -n openstack -l service=swift,component=swift-proxy -o name | head -n 1) swift-recon --diskusage

    Example output

    [2026-04-16 10:30:15] Checking disk usage on 5 hosts...
    -> 192.168.122.100:6200: 0.00% used (100.00 GiB / 100.00 GiB)
    -> 192.168.122.101:6200: 0.00% used (100.00 GiB / 100.00 GiB)
    -> 192.168.122.102:6200: 0.00% used (100.00 GiB / 100.00 GiB)
    -> 192.168.122.103:6200: 0.00% used (100.00 GiB / 100.00 GiB)
    -> 192.168.122.104:6200: 0.00% used (100.00 GiB / 100.00 GiB)

    The number of hosts and total capacity matches your expected configuration.

Verification

  • Verify that all object replicas have been placed correctly after the rebalance:

    $ oc debug --keep-labels=true job/swift-ring-rebalance -- /bin/sh -c 'swift-ring-tool get && swift-dispersion-report'

    Example output

    Queried 1024 objects for dispersion reporting, 3s, 0 retries
    100.00% of object copies found (3072 of 3072)
    Queried 1024 containers for dispersion reporting, 2s, 0 retries
    100.00% of container copies found (3072 of 3072)

    All values must show 100.00% before you perform another scaling operation or ring rebalance.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部