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 <andrej.babolcai@gmail.com>
Change-Id: I254e35a67195817c237dba00bec6338d3fffa985
This commit is contained in:
Andrej Babolcai 2022-11-16 09:34:48 +01:00
parent 0b14d1ebae
commit 89a6bb0718
2 changed files with 11 additions and 2 deletions

View File

@ -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.

View File

@ -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 %}