From 2bea8d8ecf3e97d8635ecb3f81ebf838ffa176ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Tue, 2 Oct 2018 18:10:19 +0200 Subject: [PATCH] handler: add support for ceph-volume containerized restart MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The restart script wasn't working with the current new addition of ceph-volume in container where now OSDs have the OSD id name in the container name. Signed-off-by: Sébastien Han --- roles/ceph-handler/templates/restart_osd_daemon.sh.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 b/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 index 15b255900..09de06d5c 100644 --- a/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 +++ b/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 @@ -66,12 +66,16 @@ for unit in $(systemctl list-units | grep -E "loaded * active" | grep -oE "ceph- # We need to wait because it may take some time for the socket to actually exists COUNT=10 # Wait and ensure the socket exists after restarting the daemon - {% if containerized_deployment -%} + {% if containerized_deployment and osd_scenario != 'lvm' -%} id=$(get_dev_name "$unit") container_id=$(get_docker_id_from_dev_name "$id") wait_for_socket_in_docker "$container_id" osd_id=$whoami docker_exec="docker exec $container_id" + {% elif containerized_deployment and osd_scenario == 'lvm' %} + osd_id=$(echo ${unit#ceph-osd@} | grep -oE '[0-9]+') + container_id=$(get_docker_id_from_dev_name "ceph-osd-${osd_id}") + docker_exec="docker exec $container_id" {% else %} osd_id=$(echo ${unit#ceph-osd@} | grep -oE '[0-9]+') {% endif %} -- 2.39.5