From 88c9f6d96923f0f1990e9006e8f8e2a0bf968931 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 5 Aug 2020 18:02:48 +0200 Subject: [PATCH] common: don't enable debug log on ceph-volume calls by default ceph-volume can generate large logs at some point. debug logs by definition should be enabled only when debugging. Let's make it customizable with a variable which is set to `False` by default. Signed-off-by: Guillaume Abrioux (cherry picked from commit 448cc280b7919ac7d19d854a92e3ed367b361ccc) --- group_vars/all.yml.sample | 4 +++- group_vars/rhcs.yml.sample | 4 +++- infrastructure-playbooks/filestore-to-bluestore.yml | 4 ++-- infrastructure-playbooks/purge-cluster.yml | 4 ++-- infrastructure-playbooks/purge-container-cluster.yml | 4 ++-- infrastructure-playbooks/rolling_update.yml | 4 ++-- infrastructure-playbooks/shrink-osd.yml | 2 +- infrastructure-playbooks/storage-inventory.yml | 2 +- roles/ceph-config/tasks/main.yml | 6 +++--- roles/ceph-defaults/defaults/main.yml | 3 +++ roles/ceph-osd/tasks/scenarios/lvm-batch.yml | 2 +- roles/ceph-osd/tasks/scenarios/lvm.yml | 2 +- 12 files changed, 24 insertions(+), 17 deletions(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 1fa164d31..918dcce25 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -324,6 +324,8 @@ dummy: #mon_host_v2: # suffix: ':3300' +#enable_ceph_volume_debug: False + ########## # CEPHFS # ########## @@ -883,4 +885,4 @@ dummy: #container_exec_cmd: #docker: false - +#ceph_volume_debug: "{{ enable_ceph_volume_debug | ternary(1, 0) }}" diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index 6c09dda99..fe42feb9a 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -324,6 +324,8 @@ ceph_iscsi_config_dev: false #mon_host_v2: # suffix: ':3300' +#enable_ceph_volume_debug: False + ########## # CEPHFS # ########## @@ -883,4 +885,4 @@ alertmanager_container_image: registry.redhat.io/openshift4/ose-prometheus-alert #container_exec_cmd: #docker: false - +#ceph_volume_debug: "{{ enable_ceph_volume_debug | ternary(1, 0) }}" diff --git a/infrastructure-playbooks/filestore-to-bluestore.yml b/infrastructure-playbooks/filestore-to-bluestore.yml index 73be95345..a81ad4fda 100644 --- a/infrastructure-playbooks/filestore-to-bluestore.yml +++ b/infrastructure-playbooks/filestore-to-bluestore.yml @@ -217,7 +217,7 @@ osd_fsid: "{{ item.osd_fsid }}" destroy: false environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" loop: "{{ osd_fsid_list }}" @@ -229,7 +229,7 @@ data: "{{ item.device }}" destroy: true environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" loop: "{{ osd_fsid_list }}" diff --git a/infrastructure-playbooks/purge-cluster.yml b/infrastructure-playbooks/purge-cluster.yml index a428361ed..ce3bf4c34 100644 --- a/infrastructure-playbooks/purge-cluster.yml +++ b/infrastructure-playbooks/purge-cluster.yml @@ -499,7 +499,7 @@ wal_vg: "{{ item.wal_vg|default(omit) }}" action: "zap" environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" with_items: "{{ lvm_volumes }}" when: - lvm_volumes | default([]) | length > 0 @@ -510,7 +510,7 @@ data: "{{ item }}" action: "zap" environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" with_items: "{{ devices | default([]) }}" when: - devices | default([]) | length > 0 diff --git a/infrastructure-playbooks/purge-container-cluster.yml b/infrastructure-playbooks/purge-container-cluster.yml index 0a3a6acda..32890a24e 100644 --- a/infrastructure-playbooks/purge-container-cluster.yml +++ b/infrastructure-playbooks/purge-container-cluster.yml @@ -301,7 +301,7 @@ wal_vg: "{{ item.wal_vg|default(omit) }}" action: "zap" environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" with_items: "{{ lvm_volumes }}" @@ -312,7 +312,7 @@ data: "{{ item }}" action: "zap" environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" with_items: "{{ devices | default([]) }}" diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 4cdae47cf..4fd314f13 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -407,7 +407,7 @@ - name: scan ceph-disk osds with ceph-volume if deploying nautilus command: "ceph-volume --cluster={{ cluster }} simple scan --force" environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" when: - ceph_release in ["nautilus", "octopus"] - not containerized_deployment | bool @@ -415,7 +415,7 @@ - name: activate scanned ceph-disk osds and migrate to ceph-volume if deploying nautilus command: "ceph-volume --cluster={{ cluster }} simple activate --all" environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" when: - ceph_release in ["nautilus", "octopus"] - not containerized_deployment | bool diff --git a/infrastructure-playbooks/shrink-osd.yml b/infrastructure-playbooks/shrink-osd.yml index d08db5c10..6e21c3614 100644 --- a/infrastructure-playbooks/shrink-osd.yml +++ b/infrastructure-playbooks/shrink-osd.yml @@ -211,7 +211,7 @@ action: "zap" osd_fsid: "{{ item.1 }}" environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" delegate_to: "{{ item.0 }}" diff --git a/infrastructure-playbooks/storage-inventory.yml b/infrastructure-playbooks/storage-inventory.yml index 2284587ed..708262ec6 100644 --- a/infrastructure-playbooks/storage-inventory.yml +++ b/infrastructure-playbooks/storage-inventory.yml @@ -28,6 +28,6 @@ ceph_volume: action: "inventory" environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" diff --git a/roles/ceph-config/tasks/main.yml b/roles/ceph-config/tasks/main.yml index 98ac4813d..9a94a485b 100644 --- a/roles/ceph-config/tasks/main.yml +++ b/roles/ceph-config/tasks/main.yml @@ -26,7 +26,7 @@ action: "inventory" register: rejected_devices environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" PYTHONIOENCODING: utf-8 @@ -53,7 +53,7 @@ action: "batch" register: lvm_batch_report environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" PYTHONIOENCODING: utf-8 @@ -73,7 +73,7 @@ action: "list" register: lvm_list environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" PYTHONIOENCODING: utf-8 diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index ad753300d..5d88e79e0 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -316,6 +316,8 @@ mon_host_v1: mon_host_v2: suffix: ':3300' +enable_ceph_volume_debug: False + ########## # CEPHFS # ########## @@ -875,3 +877,4 @@ use_fqdn_yes_i_am_sure: false container_exec_cmd: docker: false +ceph_volume_debug: "{{ enable_ceph_volume_debug | ternary(1, 0) }}" \ No newline at end of file diff --git a/roles/ceph-osd/tasks/scenarios/lvm-batch.yml b/roles/ceph-osd/tasks/scenarios/lvm-batch.yml index 5826af0f2..4b4ed4f4a 100644 --- a/roles/ceph-osd/tasks/scenarios/lvm-batch.yml +++ b/roles/ceph-osd/tasks/scenarios/lvm-batch.yml @@ -14,7 +14,7 @@ wal_devices: "{{ bluestore_wal_devices | unique if bluestore_wal_devices | length > 0 else omit }}" action: "batch" environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" PYTHONIOENCODING: utf-8 diff --git a/roles/ceph-osd/tasks/scenarios/lvm.yml b/roles/ceph-osd/tasks/scenarios/lvm.yml index 40dbe8f52..a2a5940a9 100644 --- a/roles/ceph-osd/tasks/scenarios/lvm.yml +++ b/roles/ceph-osd/tasks/scenarios/lvm.yml @@ -15,7 +15,7 @@ dmcrypt: "{{ dmcrypt|default(omit) }}" action: "{{ 'prepare' if containerized_deployment else 'create' }}" environment: - CEPH_VOLUME_DEBUG: 1 + CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}" PYTHONIOENCODING: utf-8 -- 2.39.5