Set hierdata for swift server workers conditionally

If not set, it would use the default os_workers fact instead of 'auto'
and limit the number of worker processes.

Change-Id: I69f51bb38f1307cf4b750e5ffb394eb215df1d9e
This commit is contained in:
Rabi Mishra 2018-10-18 15:52:52 +05:30
parent 84754fb794
commit b450b3aa39
3 changed files with 34 additions and 8 deletions

View File

@ -43,7 +43,7 @@ parameters:
description: Timeout for requests going from swift-proxy to swift a/c/o services.
type: number
SwiftWorkers:
default: auto
default: 0
description: Number of workers for Swift service.
type: string
KeystoneRegion:
@ -98,6 +98,7 @@ conditions:
use_tls_proxy: {equals : [{get_param: EnableInternalTLS}, true]}
swift_encryption_enabled: {equals : [{get_param: SwiftEncryptionEnabled}, true]}
cors_allowed_origin_unset: {equals : [{get_param: SwiftCorsAllowedOrigin}, '']}
swift_workers_zero: {equals : [{get_param: SwiftWorkers}, '0']}
resources:
SwiftBase:
@ -140,7 +141,11 @@ outputs:
swift::proxy::authtoken::project_name: 'service'
swift::proxy::s3token::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri]}
swift::proxy::node_timeout: {get_param: SwiftProxyNodeTimeout}
swift::proxy::workers: {get_param: SwiftWorkers}
-
if:
- swift_workers_zero
- {}
- swift::proxy::workers: {get_param: SwiftWorkers}
-
if:
- ceilometer_pipeline_enabled

View File

@ -46,15 +46,15 @@ parameters:
default: 'overcloud-swift-storage'
type: string
SwiftAccountWorkers:
default: auto
default: 0
description: Number of workers for Swift account service.
type: string
SwiftContainerWorkers:
default: auto
default: 0
description: Number of workers for Swift account service.
type: string
SwiftObjectWorkers:
default: auto
default: 0
description: Number of workers for Swift account service.
type: string
SwiftUseLocalDir:
@ -97,6 +97,9 @@ conditions:
equals:
- get_param: SwiftRawDisks
- {}
account_workers_zero: {equals : [{get_param: SwiftAccountWorkers}, '0']}
container_workers_zero: {equals : [{get_param: SwiftContainerWorkers}, '0']}
object_workers_zero: {equals : [{get_param: SwiftObjectWorkers}, '0']}
outputs:
role_data:
@ -136,9 +139,21 @@ outputs:
"%{hiera('$NETWORK')}"
params:
$NETWORK: {get_param: [ServiceNetMap, SwiftStorageNetwork]}
swift::storage::all::account_server_workers: {get_param: SwiftAccountWorkers}
swift::storage::all::container_server_workers: {get_param: SwiftContainerWorkers}
swift::storage::all::object_server_workers: {get_param: SwiftObjectWorkers}
-
if:
- account_workers_zero
- {}
- swift::storage::all::account_server_workers: {get_param: SwiftAccountWorkers}
-
if:
- container_workers_zero
- {}
- swift::storage::all::container_server_workers: {get_param: SwiftContainerWorkers}
-
if:
- object_workers_zero
- {}
- swift::storage::all::object_server_workers: {get_param: SwiftObjectWorkers}
step_config: |
include ::tripleo::profile::base::swift::storage
upgrade_tasks:

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
swift worker count parameter defaults have been changed from 'auto' to
0. If not provided, puppet module default would instead be used and the
number of server processes will be limited to '12'.