From 47f93e1792a99f2226b5842978cd99dd2d9ef3fb Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Fri, 12 Oct 2018 13:48:22 +0200 Subject: [PATCH] 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 --- docker/services/swift-storage.yaml | 449 +++++++++++++++-------------- environments/undercloud.yaml | 1 + 2 files changed, 232 insertions(+), 218 deletions(-) diff --git a/docker/services/swift-storage.yaml b/docker/services/swift-storage.yaml index 40007d3622..da1ecc097d 100644 --- a/docker/services/swift-storage.yaml +++ b/docker/services/swift-storage.yaml @@ -49,6 +49,10 @@ parameters: default: {} description: 'A hash of additional raw devices to use as Swift backend (eg. {sdb: {}})' type: json + SwiftReplicas: + type: number + default: 3 + description: How many replicas to use in the swift rings. SwiftUseLocalDir: default: true 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 type: boolean +conditions: + single_replica_mode: {equals: [{get_param: SwiftReplicas}, 1]} + resources: ContainersCommon: @@ -218,224 +225,230 @@ outputs: volumes: - /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:rw,z step_4: - swift_account_auditor: - image: *swift_account_image - net: host - user: swift - restart: always - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_account_auditor.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:z - - /dev:/dev - - /var/cache/swift:/var/cache/swift:z - environment: &kolla_env - - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - swift_account_reaper: - image: *swift_account_image - net: host - user: swift - restart: always - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_account_reaper.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:z - - /dev:/dev - - /var/cache/swift:/var/cache/swift:z - environment: *kolla_env - swift_account_replicator: - image: *swift_account_image - net: host - user: swift - restart: always - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_account_replicator.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:/var/cache/swift - environment: *kolla_env - swift_account_server: - image: *swift_account_image - net: host - user: swift - restart: always - healthcheck: - test: /openstack/healthcheck - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_account_server.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:/var/cache/swift - environment: *kolla_env - swift_container_auditor: - image: &swift_container_image {get_param: DockerSwiftContainerImage} - net: host - user: swift - restart: always - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_container_auditor.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:/var/cache/swift - environment: *kolla_env - swift_container_replicator: - image: *swift_container_image - net: host - user: swift - restart: always - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_container_replicator.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:/var/cache/swift - environment: *kolla_env - swift_container_updater: - image: *swift_container_image - net: host - user: swift - restart: always - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_container_updater.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:/var/cache/swift - environment: *kolla_env - swift_container_server: - image: *swift_container_image - net: host - user: swift - restart: always - healthcheck: - test: /openstack/healthcheck - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_container_server.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:/var/cache/swift - environment: *kolla_env - swift_object_auditor: - image: &swift_object_image {get_param: DockerSwiftObjectImage} - net: host - user: swift - restart: always - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_object_auditor.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:/var/cache/swift - environment: *kolla_env - swift_object_expirer: - image: &swift_proxy_image {get_param: DockerSwiftProxyImage} - net: host - user: swift - restart: always - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_object_expirer.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:/var/cache/swift - environment: *kolla_env - swift_object_replicator: - image: *swift_object_image - net: host - user: swift - restart: always - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_object_replicator.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:/var/cache/swift - environment: *kolla_env - swift_object_updater: - image: *swift_object_image - net: host - user: swift - restart: always - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_object_updater.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:/var/cache/swift - environment: *kolla_env - swift_object_server: - image: *swift_object_image - net: host - user: swift - restart: always - healthcheck: - test: /openstack/healthcheck - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /var/lib/kolla/config_files/swift_object_server.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:/var/cache/swift - environment: *kolla_env - swift_rsync: - image: *swift_object_image - net: host - user: root - restart: always - privileged: true - volumes: - list_concat: - - {get_attr: [ContainersCommon, volumes]} - - - - /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 + map_merge: + - if: + - single_replica_mode + - {} + - + swift_account_auditor: + image: *swift_account_image + net: host + user: swift + restart: always + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_account_auditor.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:z + - /dev:/dev + - /var/cache/swift:/var/cache/swift:z + environment: &kolla_env + - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS + swift_account_replicator: + image: *swift_account_image + net: host + user: swift + restart: always + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_account_replicator.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:/var/cache/swift + environment: *kolla_env + swift_container_auditor: + image: &swift_container_image {get_param: DockerSwiftContainerImage} + net: host + user: swift + restart: always + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_container_auditor.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:/var/cache/swift + environment: *kolla_env + swift_container_replicator: + image: *swift_container_image + net: host + user: swift + restart: always + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_container_replicator.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:/var/cache/swift + environment: *kolla_env + swift_object_auditor: + image: &swift_object_image {get_param: DockerSwiftObjectImage} + net: host + user: swift + restart: always + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_object_auditor.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:/var/cache/swift + environment: *kolla_env + swift_object_replicator: + image: *swift_object_image + net: host + user: swift + restart: always + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_object_replicator.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:/var/cache/swift + environment: *kolla_env + - + swift_account_reaper: + image: *swift_account_image + net: host + user: swift + restart: always + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_account_reaper.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:z + - /dev:/dev + - /var/cache/swift:/var/cache/swift:z + environment: *kolla_env + swift_account_server: + image: *swift_account_image + net: host + user: swift + restart: always + healthcheck: + test: /openstack/healthcheck + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_account_server.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:/var/cache/swift + environment: *kolla_env + swift_container_updater: + image: *swift_container_image + net: host + user: swift + restart: always + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_container_updater.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:/var/cache/swift + environment: *kolla_env + swift_container_server: + image: *swift_container_image + net: host + user: swift + restart: always + healthcheck: + test: /openstack/healthcheck + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_container_server.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:/var/cache/swift + environment: *kolla_env + swift_object_expirer: + image: &swift_proxy_image {get_param: DockerSwiftProxyImage} + net: host + user: swift + restart: always + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_object_expirer.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:/var/cache/swift + environment: *kolla_env + swift_object_updater: + image: *swift_object_image + net: host + user: swift + restart: always + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_object_updater.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:/var/cache/swift + environment: *kolla_env + swift_object_server: + image: *swift_object_image + net: host + user: swift + restart: always + healthcheck: + test: /openstack/healthcheck + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/swift_object_server.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:/var/cache/swift + environment: *kolla_env + swift_rsync: + image: *swift_object_image + net: host + user: root + restart: always + privileged: true + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /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: - name: create persistent directories diff --git a/environments/undercloud.yaml b/environments/undercloud.yaml index d909673a9e..7d0097e63c 100644 --- a/environments/undercloud.yaml +++ b/environments/undercloud.yaml @@ -119,6 +119,7 @@ parameter_defaults: NeutronVniRanges: '10:100' NeutronPortQuota: '-1' SwiftCorsAllowedOrigin: '*' + SwiftReplicas: 1 # A list of static routes for the control plane network. Ensure traffic to # nodes on remote control plane networks use the correct network path. # Example: