]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
containers: modify bindmount option
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 17 Nov 2020 03:35:27 +0000 (04:35 +0100)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Tue, 17 Nov 2020 17:27:07 +0000 (12:27 -0500)
This commit changes the bind mount option for the mount point
`/var/lib/ceph` in the systemd template for mon and mgr containers. This
is needed in case of collocating mon/mgr with osds using dmcrypt
scenario.
Once mon/mgr got converted to containers, the dmcrypt layer sub mount is
still seen in `/var/lib/ceph`. For some reason it makes the
corresponding devices busy so any other container can't open/close it.
As a result, it prevents osds from starting properly.

Since it only happens on the nodes converted before the OSD play, the idea is
to bind mount `/var/lib/ceph` on mon and mgr with the `rshared` option
so once the sub mount is unmounted, it is propagated inside the
container so it doesn't see that mount point.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1896392
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit f5ba6d9b0117d283c44cc96af1810bf4cbb29b0a)

roles/ceph-mgr/templates/ceph-mgr.service.j2
roles/ceph-mon/templates/ceph-mon.service.j2

index 136d63f77c6cd275eb9dcbed7e198e61facc6f5c..acd5dfa83598c49a484d9bf066b21f045e7789b0 100644 (file)
@@ -22,7 +22,7 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
 {% endif %}
   --memory={{ ceph_mgr_docker_memory_limit }} \
   --cpus={{ ceph_mgr_docker_cpu_limit }} \
-  -v /var/lib/ceph:/var/lib/ceph:z \
+  -v /var/lib/ceph:/var/lib/ceph:z,rshared \
   -v /etc/ceph:/etc/ceph:z \
   -v /var/run/ceph:/var/run/ceph:z \
   -v /etc/localtime:/etc/localtime:ro \
index 22c87e413546ba6e2b680e48757920abc0ef4769..5f7a9d4ba47742239005822fbb31aeb16f09891a 100644 (file)
@@ -21,7 +21,7 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-mon-%i \
 {% endif %}
   --memory={{ ceph_mon_docker_memory_limit }} \
   --cpus={{ ceph_mon_docker_cpu_limit }} \
-  -v /var/lib/ceph:/var/lib/ceph:z \
+  -v /var/lib/ceph:/var/lib/ceph:z,rshared \
   -v /etc/ceph:/etc/ceph:z \
   -v /var/run/ceph:/var/run/ceph:z \
   -v /etc/localtime:/etc/localtime:ro \