From 89a6bb07187f87aa8aab11ffba14f0248019886f Mon Sep 17 00:00:00 2001 From: Andrej Babolcai Date: Wed, 16 Nov 2022 09:34:48 +0100 Subject: [PATCH] Add support for running object-servers Per Disk Adds support for configuring different storage port per disk in the storage policy ring. This Swift feature is described here https://docs.openstack.org/swift/latest/deployment_guide.html#running-object-servers-per-disk Signed-off-by: Andrej Babolcai Change-Id: I254e35a67195817c237dba00bec6338d3fffa985 --- doc/source/configure-swift-config.rst | 7 +++++++ templates/ring.contents.j2 | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/source/configure-swift-config.rst b/doc/source/configure-swift-config.rst index 30fb7ddf..3d739a28 100644 --- a/doc/source/configure-swift-config.rst +++ b/doc/source/configure-swift-config.rst @@ -225,6 +225,8 @@ file** # weight: 75 # groups: # - gold + # storage_port: 6010 + # repl_port: 6110 # - name: sdc # - name: sdd # - name: sde @@ -249,6 +251,11 @@ file** If neither are specified, both default to the host IP address. + ``storage_port`` and ``repl_port`` + Used to enable running object servers per disk. The default value + for both is ``swift_object_port``. + https://docs.openstack.org/swift/latest/deployment_guide.html + ``zone`` The default is 0. Optionally, set the swift zone for the ring. diff --git a/templates/ring.contents.j2 b/templates/ring.contents.j2 index 96266ff3..4788b6c1 100644 --- a/templates/ring.contents.j2 +++ b/templates/ring.contents.j2 @@ -69,15 +69,17 @@ {% set weight = drive.weight | default(swift_vars.weight | default(swift.weight | default(swift_default_drive_weight))) %} {% set region = drive.region | default(swift_vars.region | default(swift.region | default(swift_default_host_region))) %} {% set zone = drive.zone | default(swift_vars.zone | default(swift.zone | default(swift_default_host_zone))) %} +{% set stor_port = drive.storage_port | default(port) %} +{% set repl_port = drive.repl_port | default(port) %} {### Update the device with the appropriate values #} {% set _update = device.update({'device':drive.name}) %} {% set _update = device.update({'weight': weight|int}) %} {% set _update = device.update({'region': region|int}) %} {% set _update = device.update({'zone': zone|int}) %} {% set _update = device.update({'replication_ip': repl_ip}) %} -{% set _update = device.update({'replication_port': port|int}) %} +{% set _update = device.update({'replication_port': repl_port|int}) %} {% set _update = device.update({'ip': storage_ip}) %} -{% set _update = device.update({'port': port|int}) %} +{% set _update = device.update({'port': stor_port|int}) %} {### Append the device to the drives list of the builder dict #} {% set _update = builder.drives.append(device) %} {% endif %}