Chapter 7. Configuring the Object Storage service (swift)
Configure the Object Storage service (swift) to use PersistentVolumes (PVs) on OpenShift nodes or disks on external data plane nodes.
OpenShift deployments are limited to one PV per node. However, the Object Storage service requires multiple PVs. To maximize availability and data durability, you create these PVs on different nodes, and only use one PV per node. External data plane nodes offer more flexibility for larger deployments with multiple disks per node.
For information about configuring the Object Storage service as an endpoint for the Red Hat Ceph Storage Object Gateway (RGW), see Configuring an external Ceph Object Gateway back end.
7.1. Prerequisites Copy linkLink copied to clipboard!
-
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.
7.2. Deploying the Object Storage service on OpenShift nodes by using PersistentVolumes Copy linkLink copied to clipboard!
You use at least two swiftProxy replicas and three swiftStorage replicas in a default Object Storage service (swift) deployment. You can increase these values to distribute storage across more nodes and disks.
The ringReplicas value defines the number of object copies in the cluster. For example, if you set ringReplicas: 3 and swiftStorage/replicas: 5, every object is stored on 3 different PersistentVolumes (PVs), and there are 5 PVs in total.
Procedure
Open your
OpenStackControlPlaneCR file,openstack_control_plane.yaml, and add the following parameters to theswifttemplate:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Increase the
swiftProxy/replicas:value to distribute proxy instances across more nodes. -
Replace the
ringReplicas:value to define the number of object copies you want in your cluster. -
Increase the
swiftStorage/replicas:value to define the number of PVs in your cluster. -
Replace
<swift-storage>with the name of the storage class you want the Object Storage service to use.
-
Increase the
Update the control plane:
oc apply -f openstack_control_plane.yaml -n openstack
$ oc apply -f openstack_control_plane.yaml -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow Wait until RHOCP creates the resources related to the
OpenStackControlPlaneCR. Run the following command to check the status:oc get openstackcontrolplane -n openstack
$ oc get openstackcontrolplane -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
OpenStackControlPlaneresources are created when the status is "Setup complete".TipAppend the
-woption to the end of thegetcommand to track deployment progress.
7.3. Deploying the Object Storage service on external data plane nodes Copy linkLink copied to clipboard!
If you operate large clusters with a lot of storage in your Red Hat OpenStack Services on OpenShift (RHOSO) deployment, you can deploy the Object Storage service (swift) on external data plane nodes. With this configuration, the Object Storage proxy service continues to run on on the control plane and the Object Storage services run on the data plane nodes.
If you do not want to use persistent volumes for data storage, set swiftStorage replicas to 0 in the OpenStackControlPlane CR. When initially creating the OpenStackControlPlane CR, you must also set swiftProxy replicas to 0. This is necessary because the proxies for the Object Storage service require properly built rings with at least the configured number of replica devices to start. Once the data plane is deployed, you can then scale the swiftProxy replicas to the number you want.
To deploy and run the Object Storage services on data plane nodes, first you enable DNS forwarding to resolve data plane host names in the control plane pods, and then you create an OpenStackDataPlaneNodeSet CR with the following properties:
-
The
swiftservice - A list of disks to be used for Object Storage service storage
Procedure
Enable DNS forwarding to resolve data plane hostnames in the control plane pods.
Obtain the
clusterIPof the resolver:oc get svc dnsmasq-dns -o jsonpath=`{.spec.clusterIP}`$ oc get svc dnsmasq-dns -o jsonpath=`{.spec.clusterIP}`Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the default DNS entry to add the
clusterIPof the resolver:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<clusterIP>with theclusterIPof the resolver.
-
Replace
Enable the
swiftstorage service on the data plane nodes by adding theswiftservice to the end of the list of services for theNodeSetin yourOpenStackDataPlaneNodeSetCR. The service runs the playbooks that are required to configure the Object Storage services:Example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Define disks to be used by the Object Storage service on data plane nodes.
When you define disks, you can do the following:
-
Define the disks in the global
nodeTemplatesection in yourOpenStackDataPlaneNodeSetCR to use the same type of disks for all nodes. -
Define disks on a per-node basis in the
nodessection of yourOpenStackDataPlaneNodeSetCR. - Assign disks to a specific region or zone.
- Enable ring management to distribute replicas.
-
Define the disks in the global
You must specify a weight for each disk. If you do not have custom weights in your existing rings, you can set the weight to the GiB capacity of the disk.
The following example shows the
OpenStackDataPlaneNodeSetCR for a data plane with three storage nodes. Each node is configured to use two disks in thenodeTemplatesection. The first nodeedpm-swift-0is configured to use a third disk in thenodessection:Example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.4. Object Storage rings Copy linkLink copied to clipboard!
The Object Storage service (swift) uses a data structure called the ring to distribute partition space across the cluster. This partition space is core to the data durability engine in the Object Storage service. With rings, the Object Storage service can quickly and easily synchronize each partition across the cluster.
Rings contain information about Object Storage partitions and how partitions are distributed among the different nodes and disks in your Red Hat OpenStack Services on OpenShift (RHOSO) deployment. When any Object Storage component interacts with data, a quick lookup is performed locally in the ring to determine the possible partitions for each object.
The Object Storage service has three rings to store the following types of data:
- Account information
- Containers, to facilitate organizing objects under an account
- Object replicas
7.5. Ring partition power Copy linkLink copied to clipboard!
The ring power determines the partition to which a resource, such as an account, container, or object, is mapped. The partition is included in the path under which the resource is stored in a back-end file system. Therefore, changing the partition power requires relocating resources to new paths in the back-end file systems.
In a heavily populated cluster, a relocation process is time consuming. To avoid downtime, relocate resources while the cluster is still operating. You must do this without temporarily losing access to data or compromising the performance of processes, such as replication and auditing. For assistance with increasing ring partition power, contact Red Hat Support.
When you use separate nodes for the Object Storage service (swift), use a higher partition power value.
The Object Storage service distributes data across disks and nodes using modified hash rings. There are three rings by default: one for accounts, one for containers, and one for objects. Each ring uses a fixed parameter called partition power. This parameter sets the maximum number of partitions that can be created.
7.6. Increasing Object Storage ring partition power values Copy linkLink copied to clipboard!
You can only change the partition power parameter for new containers and their objects, so you must set this value before initial deployment.
The default partition power value is 10. Refer to the following table to select an appropriate partition power if you use three replicas:
| Partition Power | Maximum number of disks |
| 10 | ~ 35 |
| 11 | ~ 75 |
| 12 | ~ 150 |
| 13 | ~ 250 |
| 14 | ~ 500 |
Setting an excessively high partition power value (for example, 14 for only 40 disks) negatively impacts replication times.
Procedure
Open your
OpenStackControlPlaneCR file,openstack_control_plane.yaml, and change the value forpartPowerunder theswiftRingparameter in theswifttemplate:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<12>with the value you want to set for partition power.TipYou can also configure an additional object server ring for new containers. This is useful if you want to add more disks to an Object Storage service deployment that initially uses a low partition power.