diff --git a/defaults/main.yml b/defaults/main.yml index 5cb8d45c..c3d43679 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -135,6 +135,16 @@ swift_allow_all_users: False # If you want to regenerate the swift keys, on a run, for rsync purposes set this var to True otherwise keys will be generated on the first run and not regenerated each run. swift_recreate_keys: False swift_sorting_method: shuffle +# Set the fallocate_reserve value which will reserve space and fail on PUTs above this value in bytes (Default 10GB) +swift_fallocate_reserve: 10737418240 +swift_account_fallocate_reserve: "{{ swift_fallocate_reserve }}" +swift_container_fallocate_reserve: "{{ swift_fallocate_reserve }}" +swift_object_fallocate_reserve: "{{ swift_fallocate_reserve }}" +# Set this to true to disable fallocate +swift_disable_fallocate: false +swift_account_disable_fallocate: "{{ swift_disable_fallocate }}" +swift_container_disable_fallocate: "{{ swift_disable_fallocate }}" +swift_object_disable_fallocate: "{{ swift_disable_fallocate }}" ## Swift ceilometer variables swift_reselleradmin_role: ResellerAdmin diff --git a/releasenotes/notes/swift-fallocate-reserve-ff513025da68bfed.yaml b/releasenotes/notes/swift-fallocate-reserve-ff513025da68bfed.yaml new file mode 100644 index 00000000..eda9e921 --- /dev/null +++ b/releasenotes/notes/swift-fallocate-reserve-ff513025da68bfed.yaml @@ -0,0 +1,8 @@ +--- +features: + - Allow the fallocate_reserve option to be set (in + bytes) for Swift, to help prevent disks from filling + up and prevent a situation where Swift is unable to + remove objects due to a lack of disk space. The + fallocate_reserve value to is set to a default of + 10GB. diff --git a/templates/account-server.conf.j2 b/templates/account-server.conf.j2 index 411bf6cc..dc47ba45 100644 --- a/templates/account-server.conf.j2 +++ b/templates/account-server.conf.j2 @@ -13,6 +13,9 @@ devices = {{ swift_vars.mount_point | default(swift.mount_point) }} log_facility = LOG_LOCAL2 {% include "statsd.j2" %} +disable_fallocate = {{ swift_account_disable_fallocate }} +fallocate_reserve = {{ swift_account_fallocate_reserve }} + [pipeline:main] pipeline = healthcheck recon account-server diff --git a/templates/container-server.conf.j2 b/templates/container-server.conf.j2 index 3445b6f9..b4a779cc 100644 --- a/templates/container-server.conf.j2 +++ b/templates/container-server.conf.j2 @@ -13,6 +13,9 @@ devices = {{ swift_vars.mount_point | default(swift.mount_point) }} log_facility = LOG_LOCAL3 {% include "statsd.j2" %} +disable_fallocate = {{ swift_container_disable_fallocate }} +fallocate_reserve = {{ swift_container_fallocate_reserve }} + [pipeline:main] pipeline = healthcheck recon container-server diff --git a/templates/object-server.conf.j2 b/templates/object-server.conf.j2 index 15ee74bb..6a29cb90 100644 --- a/templates/object-server.conf.j2 +++ b/templates/object-server.conf.j2 @@ -14,6 +14,9 @@ devices = {{ swift_vars.mount_point | default(swift.mount_point) }} log_facility = LOG_LOCAL4 {% include "statsd.j2" %} +disable_fallocate = {{ swift_object_disable_fallocate }} +fallocate_reserve = {{ swift_object_fallocate_reserve }} + [pipeline:main] pipeline = healthcheck recon object-server