Chapter 6. Customizing the Object Storage service (swift) You can customize some of the default settings of the Object Storage service (swift) to optimize deployment performance. 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. 6.1. Changing default parameters for object storage You can customize the following options for your Object Storage service (swift) deployment in the OpenStackControlPlane CR: Table 6.1. OpenStackControlPlane CR options Option Description 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: Table 6.2. Configuration file options Service Key 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 Open your OpenStackControlPlane CR file, openstack_control_plane.yaml , and enable Ceilometer middleware and object encryption under the swiftProxy parameter in the swift template: Add values for minPartHours , partPower , and ringReplicas under the swiftRing parameter: 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. Change the number of workers in the object-server service by adding the defaultConfigOverwrite parameter under the swiftStorage parameter: Replace <number_of_workers> with the number of workers you want in the object-server service. Update the control plane: Wait until RHOCP creates the resources related to the OpenStackControlPlane CR. Run the following command to check the status: 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. 6.2. 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. 6.3. Checking cluster health 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 Log in to one of the Controller nodes. Run the following command: 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.

Commands:
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
spec: swift: enabled: true template: swiftProxy: swiftRing: minPartHours: <number_of_hours> partPower: <partition_power> ringReplicas: <number_of_copies>
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>
oc apply -f openstack_control_plane.yaml -n openstack
oc get openstackcontrolplane -n openstack
oc debug --keep-labels=true job/swift-ring-rebalance -- /bin/sh -c 'swift-ring-tool get && swift-recon -arqlT --md5'