From 448cc280b7919ac7d19d854a92e3ed367b361ccc 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 --- 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 ab9f2eb91..64cea5784 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 # ########## @@ -889,4 +891,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 1389defbd..ed0a1e851 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 # ########## @@ -889,4 +891,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 cd234b4d3..1ed6208df 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 21c1dad0b..91bee8eb1 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 cebad947d..db317f99b 100644 --- a/infrastructure-playbooks/purge-container-cluster.yml +++ b/infrastructure-playbooks/purge-container-cluster.yml @@ -300,7 +300,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 }}" @@ -311,7 +311,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 c70c0ab3d..97a269fa6 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -408,7 +408,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 @@ -416,7 +416,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 5a46269d6..b4bb69af1 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 bb406b477..74856b51b 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 045bfed77..9ae86b7f2 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 # ########## @@ -881,3 +883,4 @@ client_connections: {} 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 a34400e7a..0649c654f 100644 --- a/roles/ceph-osd/tasks/scenarios/lvm-batch.yml +++ b/roles/ceph-osd/tasks/scenarios/lvm-batch.yml @@ -15,7 +15,7 @@ journal_devices: "{{ dedicated_devices | unique if dedicated_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 ca248d382..3ef5967f4 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