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.
-
Do not resize existing
Prerequisites
-
You have the
occommand 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-adminprivileges. -
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
Update the
OpenStackControlPlaneCR to increase theswiftStoragereplicas 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>to5.
-
Replace
Verify that new PVCs are created and successfully bound to the storage class:
$ oc get pvc -n openstack -l service=swiftExample 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 1mAll PVCs must show a
STATUSofBound.Verify that all swift-storage pods are created and in
Runningstate:$ oc get pods -n openstack -l service=swiftExample 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 2mAll pods must show
STATUS: Runningwith all containers ready.Wait for the automatic ring rebalance to complete:
$ oc get job -n openstack -l job-name=swift-ring-rebalanceExample output
NAME COMPLETIONS DURATION AGE swift-ring-rebalance 1/1 45s 3mThe job is complete when
COMPLETIONSshows1/1.注意The
swift-operatorautomatically triggers a ring rebalance when you add storage devices. However, the rebalance respects theminPartHoursinterval (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.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 --diskusageExample 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.