Disable Swift auditors/replicators on undercloud

Maintain parity with instack-undercloud
Ic93082282e9ea481c13832f8ce1265a47f0ef3d5

Swift is using only a single replica on the undercloud. Therefore
recovering from a corrupted or lost object is not possible, and running
replicators and auditors only wastes resources. And may create some
trouble. For example, the DB replicators and auditors will lock the DB,
and new objects won't be stored during that time.

Related-Bug: #1632885
Closes-Bug: #1797167

Change-Id: I584cdb03b99721fbdc28bf7f6019d914586341d2
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2018-10-12 13:48:22 +02:00
parent ad06ebce20
commit 47f93e1792
2 changed files with 232 additions and 218 deletions

View File

@ -49,6 +49,10 @@ parameters:
default: {} default: {}
description: 'A hash of additional raw devices to use as Swift backend (eg. {sdb: {}})' description: 'A hash of additional raw devices to use as Swift backend (eg. {sdb: {}})'
type: json type: json
SwiftReplicas:
type: number
default: 3
description: How many replicas to use in the swift rings.
SwiftUseLocalDir: SwiftUseLocalDir:
default: true default: true
description: 'Use a local directory for Swift storage services when building rings' description: 'Use a local directory for Swift storage services when building rings'
@ -58,6 +62,9 @@ parameters:
description: Remove package if the service is being disabled during upgrade description: Remove package if the service is being disabled during upgrade
type: boolean type: boolean
conditions:
single_replica_mode: {equals: [{get_param: SwiftReplicas}, 1]}
resources: resources:
ContainersCommon: ContainersCommon:
@ -218,224 +225,230 @@ outputs:
volumes: volumes:
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:rw,z - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:rw,z
step_4: step_4:
swift_account_auditor: map_merge:
image: *swift_account_image - if:
net: host - single_replica_mode
user: swift - {}
restart: always -
volumes: swift_account_auditor:
list_concat: image: *swift_account_image
- {get_attr: [ContainersCommon, volumes]} net: host
- user: swift
- /var/lib/kolla/config_files/swift_account_auditor.json:/var/lib/kolla/config_files/config.json:ro restart: always
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro volumes:
- /srv/node:/srv/node:z list_concat:
- /dev:/dev - {get_attr: [ContainersCommon, volumes]}
- /var/cache/swift:/var/cache/swift:z -
environment: &kolla_env - /var/lib/kolla/config_files/swift_account_auditor.json:/var/lib/kolla/config_files/config.json:ro
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
swift_account_reaper: - /srv/node:/srv/node:z
image: *swift_account_image - /dev:/dev
net: host - /var/cache/swift:/var/cache/swift:z
user: swift environment: &kolla_env
restart: always - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
volumes: swift_account_replicator:
list_concat: image: *swift_account_image
- {get_attr: [ContainersCommon, volumes]} net: host
- user: swift
- /var/lib/kolla/config_files/swift_account_reaper.json:/var/lib/kolla/config_files/config.json:ro restart: always
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro volumes:
- /srv/node:/srv/node:z list_concat:
- /dev:/dev - {get_attr: [ContainersCommon, volumes]}
- /var/cache/swift:/var/cache/swift:z -
environment: *kolla_env - /var/lib/kolla/config_files/swift_account_replicator.json:/var/lib/kolla/config_files/config.json:ro
swift_account_replicator: - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
image: *swift_account_image - /srv/node:/srv/node
net: host - /dev:/dev
user: swift - /var/cache/swift:/var/cache/swift
restart: always environment: *kolla_env
volumes: swift_container_auditor:
list_concat: image: &swift_container_image {get_param: DockerSwiftContainerImage}
- {get_attr: [ContainersCommon, volumes]} net: host
- user: swift
- /var/lib/kolla/config_files/swift_account_replicator.json:/var/lib/kolla/config_files/config.json:ro restart: always
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro volumes:
- /srv/node:/srv/node list_concat:
- /dev:/dev - {get_attr: [ContainersCommon, volumes]}
- /var/cache/swift:/var/cache/swift -
environment: *kolla_env - /var/lib/kolla/config_files/swift_container_auditor.json:/var/lib/kolla/config_files/config.json:ro
swift_account_server: - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
image: *swift_account_image - /srv/node:/srv/node
net: host - /dev:/dev
user: swift - /var/cache/swift:/var/cache/swift
restart: always environment: *kolla_env
healthcheck: swift_container_replicator:
test: /openstack/healthcheck image: *swift_container_image
volumes: net: host
list_concat: user: swift
- {get_attr: [ContainersCommon, volumes]} restart: always
- volumes:
- /var/lib/kolla/config_files/swift_account_server.json:/var/lib/kolla/config_files/config.json:ro list_concat:
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro - {get_attr: [ContainersCommon, volumes]}
- /srv/node:/srv/node -
- /dev:/dev - /var/lib/kolla/config_files/swift_container_replicator.json:/var/lib/kolla/config_files/config.json:ro
- /var/cache/swift:/var/cache/swift - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
environment: *kolla_env - /srv/node:/srv/node
swift_container_auditor: - /dev:/dev
image: &swift_container_image {get_param: DockerSwiftContainerImage} - /var/cache/swift:/var/cache/swift
net: host environment: *kolla_env
user: swift swift_object_auditor:
restart: always image: &swift_object_image {get_param: DockerSwiftObjectImage}
volumes: net: host
list_concat: user: swift
- {get_attr: [ContainersCommon, volumes]} restart: always
- volumes:
- /var/lib/kolla/config_files/swift_container_auditor.json:/var/lib/kolla/config_files/config.json:ro list_concat:
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro - {get_attr: [ContainersCommon, volumes]}
- /srv/node:/srv/node -
- /dev:/dev - /var/lib/kolla/config_files/swift_object_auditor.json:/var/lib/kolla/config_files/config.json:ro
- /var/cache/swift:/var/cache/swift - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
environment: *kolla_env - /srv/node:/srv/node
swift_container_replicator: - /dev:/dev
image: *swift_container_image - /var/cache/swift:/var/cache/swift
net: host environment: *kolla_env
user: swift swift_object_replicator:
restart: always image: *swift_object_image
volumes: net: host
list_concat: user: swift
- {get_attr: [ContainersCommon, volumes]} restart: always
- volumes:
- /var/lib/kolla/config_files/swift_container_replicator.json:/var/lib/kolla/config_files/config.json:ro list_concat:
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro - {get_attr: [ContainersCommon, volumes]}
- /srv/node:/srv/node -
- /dev:/dev - /var/lib/kolla/config_files/swift_object_replicator.json:/var/lib/kolla/config_files/config.json:ro
- /var/cache/swift:/var/cache/swift - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
environment: *kolla_env - /srv/node:/srv/node
swift_container_updater: - /dev:/dev
image: *swift_container_image - /var/cache/swift:/var/cache/swift
net: host environment: *kolla_env
user: swift -
restart: always swift_account_reaper:
volumes: image: *swift_account_image
list_concat: net: host
- {get_attr: [ContainersCommon, volumes]} user: swift
- restart: always
- /var/lib/kolla/config_files/swift_container_updater.json:/var/lib/kolla/config_files/config.json:ro volumes:
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro list_concat:
- /srv/node:/srv/node - {get_attr: [ContainersCommon, volumes]}
- /dev:/dev -
- /var/cache/swift:/var/cache/swift - /var/lib/kolla/config_files/swift_account_reaper.json:/var/lib/kolla/config_files/config.json:ro
environment: *kolla_env - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
swift_container_server: - /srv/node:/srv/node:z
image: *swift_container_image - /dev:/dev
net: host - /var/cache/swift:/var/cache/swift:z
user: swift environment: *kolla_env
restart: always swift_account_server:
healthcheck: image: *swift_account_image
test: /openstack/healthcheck net: host
volumes: user: swift
list_concat: restart: always
- {get_attr: [ContainersCommon, volumes]} healthcheck:
- test: /openstack/healthcheck
- /var/lib/kolla/config_files/swift_container_server.json:/var/lib/kolla/config_files/config.json:ro volumes:
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro list_concat:
- /srv/node:/srv/node - {get_attr: [ContainersCommon, volumes]}
- /dev:/dev -
- /var/cache/swift:/var/cache/swift - /var/lib/kolla/config_files/swift_account_server.json:/var/lib/kolla/config_files/config.json:ro
environment: *kolla_env - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
swift_object_auditor: - /srv/node:/srv/node
image: &swift_object_image {get_param: DockerSwiftObjectImage} - /dev:/dev
net: host - /var/cache/swift:/var/cache/swift
user: swift environment: *kolla_env
restart: always swift_container_updater:
volumes: image: *swift_container_image
list_concat: net: host
- {get_attr: [ContainersCommon, volumes]} user: swift
- restart: always
- /var/lib/kolla/config_files/swift_object_auditor.json:/var/lib/kolla/config_files/config.json:ro volumes:
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro list_concat:
- /srv/node:/srv/node - {get_attr: [ContainersCommon, volumes]}
- /dev:/dev -
- /var/cache/swift:/var/cache/swift - /var/lib/kolla/config_files/swift_container_updater.json:/var/lib/kolla/config_files/config.json:ro
environment: *kolla_env - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
swift_object_expirer: - /srv/node:/srv/node
image: &swift_proxy_image {get_param: DockerSwiftProxyImage} - /dev:/dev
net: host - /var/cache/swift:/var/cache/swift
user: swift environment: *kolla_env
restart: always swift_container_server:
volumes: image: *swift_container_image
list_concat: net: host
- {get_attr: [ContainersCommon, volumes]} user: swift
- restart: always
- /var/lib/kolla/config_files/swift_object_expirer.json:/var/lib/kolla/config_files/config.json:ro healthcheck:
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro test: /openstack/healthcheck
- /srv/node:/srv/node volumes:
- /dev:/dev list_concat:
- /var/cache/swift:/var/cache/swift - {get_attr: [ContainersCommon, volumes]}
environment: *kolla_env -
swift_object_replicator: - /var/lib/kolla/config_files/swift_container_server.json:/var/lib/kolla/config_files/config.json:ro
image: *swift_object_image - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
net: host - /srv/node:/srv/node
user: swift - /dev:/dev
restart: always - /var/cache/swift:/var/cache/swift
volumes: environment: *kolla_env
list_concat: swift_object_expirer:
- {get_attr: [ContainersCommon, volumes]} image: &swift_proxy_image {get_param: DockerSwiftProxyImage}
- net: host
- /var/lib/kolla/config_files/swift_object_replicator.json:/var/lib/kolla/config_files/config.json:ro user: swift
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro restart: always
- /srv/node:/srv/node volumes:
- /dev:/dev list_concat:
- /var/cache/swift:/var/cache/swift - {get_attr: [ContainersCommon, volumes]}
environment: *kolla_env -
swift_object_updater: - /var/lib/kolla/config_files/swift_object_expirer.json:/var/lib/kolla/config_files/config.json:ro
image: *swift_object_image - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
net: host - /srv/node:/srv/node
user: swift - /dev:/dev
restart: always - /var/cache/swift:/var/cache/swift
volumes: environment: *kolla_env
list_concat: swift_object_updater:
- {get_attr: [ContainersCommon, volumes]} image: *swift_object_image
- net: host
- /var/lib/kolla/config_files/swift_object_updater.json:/var/lib/kolla/config_files/config.json:ro user: swift
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro restart: always
- /srv/node:/srv/node volumes:
- /dev:/dev list_concat:
- /var/cache/swift:/var/cache/swift - {get_attr: [ContainersCommon, volumes]}
environment: *kolla_env -
swift_object_server: - /var/lib/kolla/config_files/swift_object_updater.json:/var/lib/kolla/config_files/config.json:ro
image: *swift_object_image - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
net: host - /srv/node:/srv/node
user: swift - /dev:/dev
restart: always - /var/cache/swift:/var/cache/swift
healthcheck: environment: *kolla_env
test: /openstack/healthcheck swift_object_server:
volumes: image: *swift_object_image
list_concat: net: host
- {get_attr: [ContainersCommon, volumes]} user: swift
- restart: always
- /var/lib/kolla/config_files/swift_object_server.json:/var/lib/kolla/config_files/config.json:ro healthcheck:
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro test: /openstack/healthcheck
- /srv/node:/srv/node volumes:
- /dev:/dev list_concat:
- /var/cache/swift:/var/cache/swift - {get_attr: [ContainersCommon, volumes]}
environment: *kolla_env -
swift_rsync: - /var/lib/kolla/config_files/swift_object_server.json:/var/lib/kolla/config_files/config.json:ro
image: *swift_object_image - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
net: host - /srv/node:/srv/node
user: root - /dev:/dev
restart: always - /var/cache/swift:/var/cache/swift
privileged: true environment: *kolla_env
volumes: swift_rsync:
list_concat: image: *swift_object_image
- {get_attr: [ContainersCommon, volumes]} net: host
- user: root
- /var/lib/kolla/config_files/swift_rsync.json:/var/lib/kolla/config_files/config.json:ro restart: always
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro privileged: true
- /srv/node:/srv/node volumes:
- /dev:/dev list_concat:
# /var/cache/swift not needed in this container - {get_attr: [ContainersCommon, volumes]}
environment: *kolla_env -
- /var/lib/kolla/config_files/swift_rsync.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
- /srv/node:/srv/node
- /dev:/dev
# /var/cache/swift not needed in this container
environment: *kolla_env
host_prep_tasks: host_prep_tasks:
- name: create persistent directories - name: create persistent directories

View File

@ -119,6 +119,7 @@ parameter_defaults:
NeutronVniRanges: '10:100' NeutronVniRanges: '10:100'
NeutronPortQuota: '-1' NeutronPortQuota: '-1'
SwiftCorsAllowedOrigin: '*' SwiftCorsAllowedOrigin: '*'
SwiftReplicas: 1
# A list of static routes for the control plane network. Ensure traffic to # A list of static routes for the control plane network. Ensure traffic to
# nodes on remote control plane networks use the correct network path. # nodes on remote control plane networks use the correct network path.
# Example: # Example: