From aaf3dff30c27ef359c5ef20580372fe17b1d195c Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 11 May 2022 13:47:46 +0200 Subject: [PATCH] cephadm-adopt: remove legacy directory after adoption When this directory is left after the osd adoption, it leads to the following error: ``` [WRN] CEPHADM_REFRESH_FAILED: failed to probe daemons or devices host axdesec2ocs1n002.ecommerce.inditex.grp `cephadm ceph-volume` failed: cephadm exited with an error code: 1, stderr:Inferring config /var/lib/ceph/41555360-e96b-4b16-a37c-873e0c940091/mon.axdesec2ocs1n002/config ERROR: [Errno 2] No such file or directory: '/var/lib/ceph/41555360-e96b-4b16-a37c-873e0c940091/mon.axdesec2ocs1n002/config'. ``` this is because of an unexpected behavior regarding 'config inferring' when a legacy directory is present in /var/lib/ceph. Note: this doesn't fix the root cause, this is a workaround. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2075510 Signed-off-by: Guillaume Abrioux (cherry picked from commit 6e2ebe857d0f8c2b9a7ebbd5c63fa54c9a603141) --- infrastructure-playbooks/cephadm-adopt.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index 94686d8fc..73b059072 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -823,6 +823,11 @@ state: absent loop: '{{ (osd_list.stdout | from_json).keys() | list }}' + - name: remove any legacy directories in /var/lib/ceph/mon (workaround) + file: + path: "/var/lib/ceph/mon/{{ cluster }}-{{ ansible_facts['hostname'] }}" + state: absent + - name: waiting for clean pgs... command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph pg stat --format json" changed_when: false